COBOL Occurs

This is a Mainframe COBOL forum - you can post your queries on Mainframe COBOL, VS COBOL II, COBOL/370 , Enterprise COBOL

Moderators: dbzTHEdinosauer, Moderator Group

Post Reply
sarayu
Member
Posts: 1
Joined: Fri Oct 31, 2008 11:20 pm

COBOL Occurs

Post by sarayu » Fri Oct 31, 2008 11:26 pm

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?

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Sat Nov 01, 2008 1:02 pm

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.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

User avatar
Natarajan
Moderator
Posts: 537
Joined: Fri Oct 10, 2008 12:57 pm
Location: chennai
Contact:

Re: COBOL Occurs

Post by Natarajan » Sat Nov 01, 2008 4:39 pm

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:
Natarajan
Chennai

academyindia4

Topic deleted by Admin

Post by academyindia4 » Wed Jan 27, 2016 8:17 pm

<< Content deleted By Admin >>

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others