IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Issue in using Depending on


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
aryanpa1

New User


Joined: 26 May 2007
Posts: 45
Location: Chennai

PostPosted: Tue Feb 24, 2009 6:17 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Feb 24, 2009 6:27 pm
Reply with quote

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
View user's profile Send private message
aryanpa1

New User


Joined: 26 May 2007
Posts: 45
Location: Chennai

PostPosted: Tue Feb 24, 2009 6:56 pm
Reply with quote

But the group levels ar different here. Even in this scenario we should not do this.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Feb 24, 2009 7:00 pm
Reply with quote

I'm not sure what you're trying to say.
Back to top
View user's profile Send private message
aryanpa1

New User


Joined: 26 May 2007
Posts: 45
Location: Chennai

PostPosted: Tue Feb 24, 2009 7:03 pm
Reply with 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)).
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Feb 24, 2009 7:19 pm
Reply with quote

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
View user's profile Send private message
aryanpa1

New User


Joined: 26 May 2007
Posts: 45
Location: Chennai

PostPosted: Tue Feb 24, 2009 11:04 pm
Reply with quote

Thanks for your valuable time guys.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts Facing ABM3 issue! CICS 3
No new posts Panvalet - 9 Character name - Issue c... CA Products 6
No new posts Issue with EXEC CICS QUERY SECURITY c... CICS 6
Search our Forums:

Back to Top