View previous topic :: View next topic
|
Author |
Message |
aryanpa1
New User
Joined: 26 May 2007 Posts: 45 Location: Chennai
|
|
|
|
Hi Team,
I am using depending on in one of my program. Below is my code and I am getting compile errors for this. Can you please suggest me.
Code: |
30 GRP-PEPNOTNINFO.
35 PIC X(012)
VALUE '<PEPNotnInfo'.
35 PIC X(001)
VALUE '>'.
35 GRP-PEPNOTN1.
40 GRP-PEPNOTN OCCURS 1 TO 25 TIMES
DEPENDING ON
WS-PEPNOT-CNT PIC X(22).
35 PIC X(004)
VALUE ' '.
35 PIC X(014)
VALUE '</PEPNotnInfo>'.
30 GRP-APPLICANTDATA.
35 PIC X(014)
VALUE '<ApplicantData'.
35 PIC X(001)
VALUE '>'.
|
Compilation error.
Code: |
35 PIC X(004)
A "VALUE" clause was specified for variably located item "FILLER". The
"VALUE" clause was discarded.
VALUE ' '.
35 PIC X(014)
A "VALUE" clause was specified for variably located item "FILLER". The
"VALUE" clause was discarded.
VALUE '</PEPNotnInfo>'.
30 GRP-APPLICANTDATA.
35 PIC X(014)
A "VALUE" clause was specified for variably located item "FILLER". The
"VALUE" clause was discarded.
VALUE '<ApplicantData'.
35 PIC X(001)
A "VALUE" clause was specified for variably located item "FILLER". The
"VALUE" clause was discarded.
VALUE '>'.
|
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
VALUE clauses cannot be placed on variables in a structure after an OCCURS DEPENDING ON. That's what the error message tells you. |
|
Back to top |
|
|
aryanpa1
New User
Joined: 26 May 2007 Posts: 45 Location: Chennai
|
|
|
|
But the group levels ar different here. Even in this scenario we should not do this. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
I'm not sure what you're trying to say. |
|
Back to top |
|
|
aryanpa1
New User
Joined: 26 May 2007 Posts: 45 Location: Chennai
|
|
|
|
I have coded 'Depending On' cluase at level 40 under Group level 35(GRP-PEPNOTN1). But I am getting error for the next group level 35(filler having pic X(004)). |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
aryanpa1,
you need to read the documentation about tables and definitions in the application programmer guide.
this comment
Quote: |
I have coded 'Depending On' cluase at level 40 under Group level 35(GRP-PEPNOTN1). But I am getting error for the next group level 35(filler having pic X(004)).
|
leads me to believe you have little or no understanding of cobol data division.
Robert simply told you that you cannnot assign VALUE clauses to data that follows an ODO.
you have value clauses that follow the ODO.
Remove them or place them in the structure before the ODO. |
|
Back to top |
|
|
aryanpa1
New User
Joined: 26 May 2007 Posts: 45 Location: Chennai
|
|
|
|
Thanks for your valuable time guys. |
|
Back to top |
|
|
|