Could we store 40 bytes in to the Variable by OCCURS



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Could we store 40 bytes in to the Variable by OCCURS

Postby ubabnahom » Sat May 16, 2009 6:58 pm

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
ubabnahom
 
Posts: 3
Joined: Tue May 12, 2009 11:18 am
Has thanked: 0 time
Been thanked: 0 time

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

 

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

Postby dick scherrer » Sat May 16, 2009 9:59 pm

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. . . :?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

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

Postby wspreeuw » Mon Jun 29, 2009 11:53 pm

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.
wspreeuw
 
Posts: 1
Joined: Mon Jun 29, 2009 11:12 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby Anuj Dhawan » Mon Jul 06, 2009 1:16 pm

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.
Anuj
Anuj Dhawan
 
Posts: 274
Joined: Mon Feb 25, 2008 3:53 am
Location: Mumbai, India
Has thanked: 6 times
Been thanked: 4 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post