Page 1 of 1

Could we store 40 bytes in to the Variable by OCCURS

PostPosted: Sat May 16, 2009 6:58 pm
by ubabnahom
Hi,

I had declare a variable with OCCURS by 10 times. So it is 40 bytes.

Could we store 40 bytes into the variable.?
please advise on this.

Thanks

Re: Could we store 40 bytes in to the Variable by OCCURS

PostPosted: Sat May 16, 2009 9:59 pm
by dick scherrer
Hello,

It will help if you clarify what you want to do. Post some bits of code to illustrate.

If you have a 40-byte variable you can surely store 40 bytes of data in it whether it is in an array or not.

I am not sure this answers your question. . . :?

Re: Could we store 40 bytes in to the Variable by OCCURS

PostPosted: Mon Jun 29, 2009 11:53 pm
by wspreeuw
Yes, move the data to the top-level data field of the table.

03 tabel-a pic x(40).
03 filler redefines tabel-a occuring 10 times.
05 field-x Pic x(4).

move field-40 to tabel-a.

Re: Could we store 40 bytes in to the Variable by OCCURS

PostPosted: Mon Jul 06, 2009 1:16 pm
by Anuj Dhawan
OCCURS by 10 times
There is no "OCCURS by" I'm aware of, it's just "OCCURS" for a table in COBOL.

If definition of the table in question is as shown by wspreeuw, yes you can store 40 bytes into the variable.