Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Multiple OCCURS depending on in same group

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
muralirajansm

New User


Joined: 19 Nov 2007
Posts: 8
Location: cheanni

PostPosted: Fri Aug 21, 2015 4:23 pm    Post subject: Multiple OCCURS depending on in same group
Reply with quote

Hi All,

I am getting a problem while using multiple OCCURS depending on in same 01 group level.

Code:
05 INDV-TABLE OCCURS 1000 TIMES
         DEPENDING ON INDV-TABLE-CNT
         INDEXED BY INDV-INDX.
   10 INDV-VAR-1     PIC X(10).
   10 INDV-VAR-2     PIC X(10).
   10 INDV-VAR-3     PIC X(10).


05 ORG-TABLE OCCURS 500 TIMES
         DEPENDING ON ORG-TABLE-CNT
         INDEXED BY ORG-INDX.
   10 ORG-VAR-1     PIC X(10).
   10 ORG-VAR-2     PIC X(10).
   10 ORG-VAR-3     PIC X(10).




Code:
MOVE 5     TO   INDV-TABLE-CNT.
MOVE 1     TO   ORG-TABLE-CNT.
:
:
:
:
SET ORG-INDX  TO 1
MOVE SPACES TO ORG-VAR-2(ORG-INDX).

I am getting SOC7 in the above move statement.
My problem is for the first Table which has OCCURS depending ON I don't have any problem.
But from the second table I am not able to access any variables and I am getting SOC7 error.

If I remove the "DEPENDING ON" from first array then the second aray is working fine as expected.
I feel that some INDEX level problem.

Can you please help me?

Code'd
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Fri Aug 21, 2015 4:29 pm    Post subject: Reply to: Multiple OCCURS
Reply with quote

Please use the Code tags to preserve spacing.

Please answer questions on your other topic. Show the definitions of your ODO items. Are you certain that the items are set to some value before you use them? What do you have for compiler option NUMPROC? Are you using compiler option SSRANGE?
Back to top
View user's profile Send private message
muralirajansm

New User


Joined: 19 Nov 2007
Posts: 8
Location: cheanni

PostPosted: Fri Aug 21, 2015 4:38 pm    Post subject: Reply to: Multiple OCCURS
Reply with quote

Hi Bill,

Please ignore my previous tpoic("OCCURS DEPENDING ON"). That was my mistake.

I am using the below compiler option only
//LINKSVC EXEC PGM=IEWL,REGION=0K,
// PARM='LIST,XREF'

I need help on this topic only. Kindly help me.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1715
Location: UK

PostPosted: Fri Aug 21, 2015 4:43 pm    Post subject:
Reply with quote

You were asked to use the code tags. Please search the forum to find out how to do this. code tags should be used when presenting code, control cards, jcl, data and anything else that needs to be in a fixed font with spacing preserved.

IEWL is the linker/binder and not the compiler so go and look at the previous setp - or your compile listing where the options are shown.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Fri Aug 21, 2015 4:51 pm    Post subject: Reply to: Multiple OCCURS
Reply with quote

You just need to find those two options on the compile listing (first page).

You haven't attempted yet to show how yours "counts" are defined, and where.

Check for other questions.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Fri Aug 21, 2015 5:56 pm    Post subject:
Reply with quote

Have you read the Enterprise COBOL Programming Guide Appendix 1.2.2.2 titled Preventing overlay when adding elements to a variable table ? If not, you need to read it carefully. COBOL can handle having multiple OCCURS DEPENDING ON under an 01 level, but the behavior is not always what the programmer expects. And compiler options can certainly impact the results!
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Fri Aug 21, 2015 8:35 pm    Post subject:
Reply with quote

You should correct your declaration.

http://www-01.ibm.com/support/knowledgecenter/?lang=en#!/SS6SG3_4.2.0/com.ibm.entcobol.doc_4.2/PGandLR/tasks/tptbl27.htm
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts Converting multiple VB files to FB fi... Viswanath Reddy JCL & VSAM 6 Mon Aug 08, 2016 11:49 pm
No new posts Execute multiple DB2 Load commands in... faizm DB2 4 Wed Aug 03, 2016 12:53 pm
This topic is locked: you cannot edit posts or make replies. JCL MULTIPLE STEP EXECUTION QUERY Susanta JCL & VSAM 18 Sat Jul 30, 2016 1:17 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us