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

Indexed variable definition in OCCURS clause


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts To search DB2 table based on Conditio... DB2 1
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
No new posts parsing variable length/position data... DFSORT/ICETOOL 5
Search our Forums:

Back to Top