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
 

 

Indexed variable definition in OCCURS clause

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

New User


Joined: 12 Jun 2005
Posts: 44
Location: Boston

PostPosted: Sun Aug 14, 2005 5:15 pm    Post subject: Indexed variable definition in OCCURS clause
Reply with quote

Hi All,
I have query with the indexed variable in COBOL with OCCURS clause.
How does system take care of the variable used for INDEXING in OCCURS clause? I want to know where it is defined in the system and what is it PIC clause?

eg: 01 TAB-NAME OCCURS 5 TIMES INDEXED BY I.

So, here where is I defined exactly when we are not declaring it in the COBOL program and what is its PIC clause?
Back to top
View user's profile Send private message

mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon Aug 15, 2005 12:53 am    Post subject:
Reply with quote

Hi KKM,

Similar to RETURN-CODE, an INDEX is not explicitly defined. It's implicit definition is PIC S9(009) COMP. But I don't think it defines the table size limit, I think that is 8Meg.
Back to top
View user's profile Send private message
harinatha

New User


Joined: 24 Jul 2005
Posts: 28

PostPosted: Sat Aug 20, 2005 10:37 am    Post subject: Re: Indexed variable definition in OCCURS clause
Reply with quote

Hi Jack,

Then what is PIC Clause for RETURN-CODE?


Thanks & Regards,
Hari.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Aug 20, 2005 9:50 pm    Post subject:
Reply with quote

Hi Hari,

From the eCOBOL pgmg ref manual:

S9(4) USAGE BINARY VALUE ZERO
Back to top
View user's profile Send private message
prasanth_thavva

New User


Joined: 28 Jul 2005
Posts: 86
Location: Chennai

PostPosted: Sun Aug 21, 2005 10:11 am    Post subject: Indexed variable definition in OCCURS clause
Reply with quote

hi ,
internally index register is maintained for each occurs --- indexed by i...
so we dont need to declare it...
note down ur syntax is wrong
O1 ...OCCURS INDEXED BY I
IN 01 a pic x(10) it is wrong to code occurs in 01 level plz correct it...
ok ,,
Back to top
View user's profile Send private message
harinatha

New User


Joined: 24 Jul 2005
Posts: 28

PostPosted: Sun Aug 21, 2005 10:12 pm    Post subject: Re: Indexed variable definition in OCCURS clause
Reply with quote

Hi Jack,

In the following line, Which u posted

S9(4) USAGE BINARY VALUE ZERO

only two types of usage
1)Computationly(COMP,COMP-1,COMP-2,COMP-3)
2)Display (Which is default)

Usage Binary is not there(according to my knowledge).

Correct me if Iam wrong.
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 Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm
No new posts Variable for cursor names ravikumar15 DB2 5 Sun Jul 17, 2016 7:08 am
No new posts Need help on SQL Dynamic WHERE Clause subratarec DB2 12 Sat Jul 16, 2016 3:11 pm
No new posts OPC JCL Variable passion_sujesh IBM Tools 5 Fri Jul 01, 2016 4:21 am
No new posts JOINKEYs and Variable files migusd SYNCSORT 8 Fri Jun 17, 2016 3:16 am


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