Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
comparision between usage is index and INDEXED By clause

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
muthukumarapandian

New User


Joined: 08 Oct 2004
Posts: 44
Location: chennai, india

PostPosted: Fri Feb 25, 2005 7:54 pm    Post subject: comparision between usage is index and INDEXED By clause
Reply with quote

Hi,

Any one can tell me the comparision between usage is index and table with subscript as indexed item.
Back to top
View user's profile Send private message
References
mdtendulkar

Active User


Joined: 29 Jul 2003
Posts: 257
Location: USA

PostPosted: Sat Feb 26, 2005 7:57 am    Post subject:
Reply with quote

Hi muthukumarapandian,

Index gives you the offset from the start position where as Subscript gives you the occurence of the item.

Please find this book for more details...search for keyword "INDEX" or "SUBSCRIPT"

COBOL Programming Guide

Hope this helps

Regards
Mayuresh
Back to top
View user's profile Send private message
muthukumarapandian

New User


Joined: 08 Oct 2004
Posts: 44
Location: chennai, india

PostPosted: Sat Feb 26, 2005 9:43 am    Post subject: Doubt on usage is index
Reply with quote

Hi,
What is the difference between usage is index and the subscript in a table declared as index.

Eg.,

01 A usage index

01 s.
02 F pic 9(3) occurs 2 times indexed by I.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1504

PostPosted: Sun Feb 27, 2005 1:34 am    Post subject:
Reply with quote

Hi M,

An index data item (as opposed to the table index) us generally used to save a table position pointer for later reference.

For example, you may want to compare 2 values in the table after you've determined they meet certain criteria. You can save the index of the 1st entry in the index data item, so when you find the 2nd you can use the index to reference that and the index data item to reference the 1st.
Back to top
View user's profile Send private message
narena

New User


Joined: 16 Mar 2005
Posts: 20

PostPosted: Thu Mar 17, 2005 2:52 pm    Post subject:
Reply with quote

Hi Muthu,

01 A usage index

01 s.
02 F pic 9(3) occurs 2 times indexed by I.

In the above example if we want to store the Value of I we use the Variable A. Becz we cannot store the value of I in an ordinary variable. Ok.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1