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
 

 

What is index incremented by?

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

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Mon Dec 10, 2007 1:34 pm    Post subject: What is index incremented by?
Reply with quote

I have a basic question to ask about indexing -- in indexing if I have to refer certain index can I access it by the bytes displacement or is it related to occurence number only?
Back to top
View user's profile Send private message

prakash271082

New User


Joined: 09 Sep 2005
Posts: 53

PostPosted: Mon Dec 10, 2007 5:28 pm    Post subject: Reply to: What is index incremented by?
Reply with quote

Hi,

Index is always incremented by Bytes Displacement, whereas the subscripts-by occurance number.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Dec 11, 2007 5:01 am    Post subject:
Reply with quote

Hello,

Keep in mind that it is valid to code:
PERFORM para VARYING THE-INDEX FROM 1 BY 1 UNTIL. . . .

Internally, bytes are used by the index, but your code might be coded as the example.
Back to top
View user's profile Send private message
Harish-Ramakrishnan

New User


Joined: 10 Mar 2006
Posts: 3
Location: MUMBAI

PostPosted: Thu Dec 13, 2007 8:43 am    Post subject: Reply to: What is index incremented by?
Reply with quote

Can i use something like the below while using the index?

Move constant to WS-table-entry(1).

Its working for me for the condition i wanted. But please let me know if it is correct?
Back to top
View user's profile Send private message
dr_te_z

New User


Joined: 08 Jun 2007
Posts: 71
Location: Zoetermeer, the Netherlands

PostPosted: Thu Dec 13, 2007 12:07 pm    Post subject: Re: Reply to: What is index incremented by?
Reply with quote

Harish-Ramakrishnan wrote:
But please let me know if it is correct?
Yes. Nothing wrong there.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Dec 13, 2007 1:07 pm    Post subject:
Reply with quote

Hi,

Browsed through the manuals, here is something to share..

INDEXEs: An item is identified as an INDEX to a given table thru the INDEXED BY option of the OCCURS clause. As shown by Dick
Quote:
PERFORM para VARYING THE-INDEX FROM 1 BY 1 UNTIL. . .


In this case, the item identified as an index can be used (for the specific table with which it is associated thru the INDEXED BY phrase)exactly as if it were a subscript, with the following exceptions:

- the initial value of an index cannot be defined; it must be given
an initial value before it is used as a subscript
- the value of an index can be set or modified only by a PERFORM,
SEARCH, or SET statement.

Furtner,

- As an IBM extension, any index can be used to reference any table.

- Each index-name specifies an index to be created by the compiler for use by the program. These index-names are not data-names and are not identified elsewhere in the COBOL program; instead, they can be regarded as private special registers for the use of this object program only. They are not data and are not part of any data hierarchy.

- Unreferenced index names need not be uniquely defined.

- In one table entry, up to 12 index-names can be specified.

- If a data item that possesses the global attribute includes a table accessed with an index, that index also possesses the global attribute. Therefore, the scope of an index-name is the same as that of the data-name that names the table in which the index is defined.

INDEXED BY phrase
This phrase is part of the OCCURS clause, The INDEXED BY phrase specifies the indexes that can be used with a table. A table without an INDEXED BY phrase can be referred to through indexing by using an index-name associated with another table.

..& as previously said..
Quote:
Move constant to WS-table-entry(1).
It's right.
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 Order BY AND Index Nileshkul DB2 2 Sat Dec 31, 2016 6:33 pm
No new posts Several errors during building altern... Andi1982 JCL & VSAM 11 Wed Jul 06, 2016 7:39 pm
No new posts Drop building Alternate Index for a p... bhavin.mehta JCL & VSAM 6 Mon Jul 04, 2016 3:47 pm
No new posts VSAM Alternate Index in CICS jacobdng CICS 2 Fri May 06, 2016 1:41 pm
No new posts Rebuilding IMS secondary index withou... Hooman24 IMS DB/DC 6 Tue Mar 29, 2016 12:22 pm


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