Page 1 of 1

COBOL Occurs

Posted: Fri Oct 31, 2008 11:26 pm
by sarayu
I have a table declared as
01 field1
05 filed2 occurs 999 times.
15 field3 occurs 100 times pic x(40)

if Im trying to access a location specified as field1 (802,150) , please let me know if its a correct to specify this way?
the field3 specified in my program is a table of 100 entries, so when im trying to access 150 th occurance what exactly happens? is this correct?

Posted: Sat Nov 01, 2008 1:02 pm
by dbzTHEdinosauer
the indexing of a demension can not exceed the occurs declaration of that demension.

150 exceeds the declaration of the 2rd demension - which is 100.

Re: COBOL Occurs

Posted: Sat Nov 01, 2008 4:39 pm
by Natarajan
sarayu wrote:I have a table declared as
01 field1
05 filed2 occurs 999 times.
15 field3 occurs 100 times pic x(40)

if Im trying to access a location specified as field1 (802,150) ,
as per my knowledge group item cannot be used for this purpose.. you can use field3(802,150) for this purpose.. since it is an COBOL elementary item.
when you try to access field3(802,150).. program will abend with SOC1 ABEND. because you are trying to access the memory area which is outside of array defined.


Refer following link for more details on normal abends...

http://www.geocities.com/srcsinc/abends.html

:roll:

Topic deleted by Admin

Posted: Wed Jan 27, 2016 8:17 pm
by academyindia4
<< Content deleted By Admin >>