A data item defined with the INDEX phrase is an index data item.
An index data item is a 4-byte elementary item (not necessarily connected with any table) that can be used to save index-name values for future reference. Through a SET statement, an index data item can be assigned an index-name value.
(occurrence-number - 1) * entry length
Any attempt to set an index-name to a value greater than 999 999 999 will leave the index-name value undefined.
Direct references to an index data item can be made only in a SEARCH statement, a SET statement, a relation condition, the USING phrase of the Procedure Division header, or the USING phrase of the CALL statement.
An index data item can be part of a group item referred to in a MOVE statement or an input/output statement.
An index data item saves values that represent table occurrences, yet is not necessarily defined as part of any table. Thus, when it is referred to directly in a SEARCH or SET statement, or indirectly in a MOVE or input/output statement, there is no conversion of values when the statement is executed.
The USAGE IS INDEX clause may be written at any level. If a group item is described with the USAGE IS INDEX clause, the elementary items within the group are index data items; the group itself is not an index data item, and the group name may not be used in SEARCH and SET statements or in relation conditions. The USAGE clause of an elementary item cannot contradict the USAGE clause of a group to which the item belongs.
An index data item cannot be a conditional variable.
The JUSTIFIED, PICTURE, BLANK WHEN ZERO, SYNCHRONIZED, TYPE, VALUE, or FORMAT clauses cannot be used to describe group or elementary items described with the USAGE IS INDEX clause.
If a source program is to be portable to other systems, it must not depend on the content of the index data item when stored in external records (since the content is system specific).