Relative Subscripting
In relative subscripting, the name of a table element is followed by a subscript of the form data-name or index-name followed by the operator + or -, and an unsigned integer literal. The operator + and - must be preceded and followed by a space. If the subscript contains a data-name, the value of the subscript is the same as if the data-name had been set up or down by the value of the integer. If the subscript contains an index-name, the integer is considered to be an occurrence number, and is converted to an index value before being added to or subtracted from the index-name. The use of relative indexing does not cause the object program to alter the value of the index.
The value of an index can be made accessible to an object program by storing the value in an index data-item. Index data-items are described in the program by a data description entry containing a USAGE IS INDEX clause. The index value is moved to the index data-item by the execution of a SET statement.
A valid index value must correspond to a table element occurrence of not less than one, nor greater than the highest permissible occurrence number.
Further information on index-names is given in the description of the INDEXED BY phrase of the OCCURS clause. See INDEXED BY Phrase.