INDEXED BY Phrase
The INDEXED BY phrase specifies the indexes that can be used with this table. The INDEXED BY phrase is required if indexing is used to refer to this table element. See Subscripting Using Index-Names (Indexing).
The value of an index is made accessible to a program by storing the value in an index data-item. Index data-items are described in the program by a data description entry containing the USAGE IS INDEX clause. The index value is moved to the index data-item through the SET statement.
- Local-Storage Section.
- Linkage Section of a program compiled with the RECURSIVE attribute.
INDEXED BY Phrase - Format .--------------. V | >>-INDEXED--+----+----index-name-1-+--------------------------->< '-BY-'
- index-name-1
- Must follow the rules for formation of user-defined words. At least
one character must be alphabetic.
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. As such, they are not data, or part of any data hierarchy; as such, each must be unique.
If a data item possessing the GLOBAL attribute includes a table accessed with an index, the index defined for the table also possess the GLOBAL attribute.
