Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts Date in where clause - Windows Karthikeyan Subbarayan DB2 9 Wed Nov 15, 2017 9:07 pm
No new posts Move from Comp3 variable to Edited Va... Revathy.nair0485 COBOL Programming 7 Fri Nov 03, 2017 3:30 pm
This topic is locked: you cannot edit posts or make replies. Can a alphanumeric data be moved to a... nico_neoz COBOL Programming 10 Mon Oct 30, 2017 8:28 am
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us