View previous topic :: View next topic
|
Author |
Message |
sreenigacc
New User
Joined: 16 Oct 2007 Posts: 15 Location: bangalore
|
|
|
|
Hi all,
I have a small query regarding index in an array.
I just want to know how the system will allocates the picture clause for index in an array.
scenario 1.
01 group-item.
05 temparature occurs 50 times pic 9(2) indexed by x1.
scenario 2
01 group-item.
05 temparature occurs 350 times pic 9(2) indexed by x2.
In Scenario 1 and Scenario 2 we don't define the pic clause for x1 & x2.
the system will allocate the memory.
but how the system will define the pic clause for x1 and x2 as per the above senarios.
thanks & Regards,
sreenivasulu G. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
They are implicitly defined as aligned binary fullwords (COMP SYNC) and are used primarily in register notation calculations.
If you generate the Assembler expansion of a COBOL program which contains INDICES you'll find their usage.
But again, they don't have an explicit PICTURE clause.
Bill |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
but how the system will define the pic clause for x1 and x2 as per the above senarios. |
The system (i.e., COBOL) will not define any picture for them -- it knows what an index is and allocates 4 bytes (one full word) for the index value. |
|
Back to top |
|
|
sreenigacc
New User
Joined: 16 Oct 2007 Posts: 15 Location: bangalore
|
|
|
|
Bill and Robert,
Thank you very much for your response.
Thanks
sreenivasulu |
|
Back to top |
|
|
|