View previous topic :: View next topic
|
Author |
Message |
muralirajansm
New User
Joined: 19 Nov 2007 Posts: 8 Location: cheanni
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
muralirajansm
New User
Joined: 19 Nov 2007 Posts: 8 Location: cheanni
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
Back to top |
|
|
|