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

comparision between usage is index and INDEXED By clause


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

New User


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

PostPosted: Fri Feb 25, 2005 7:54 pm
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
mdtendulkar

Active User


Joined: 29 Jul 2003
Posts: 237
Location: USA

PostPosted: Sat Feb 26, 2005 7:57 am
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: 42
Location: chennai, india

PostPosted: Sat Feb 26, 2005 9:43 am
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: 1592

PostPosted: Sun Feb 27, 2005 1:34 am
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: 18

PostPosted: Thu Mar 17, 2005 2:52 pm
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
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 Cobol file using index COBOL Programming 2
No new posts To search DB2 table based on Conditio... DB2 1
No new posts STEM usage in REXX CLIST & REXX 14
No new posts writing into VSAM indexed tabl in PL1... PL/I & Assembler 8
No new posts z/OS Modules Usage report using SMF 42 DFSORT/ICETOOL 2
Search our Forums:

Back to Top