Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Subscripting

Function

Subscripts are used when an individual element is to be accessed within a table (see the section "OCCURS clause").

Format 1

Describes subscripting without qualification.


{data-name-1 | condition-name} ({subscript-1}...)

Format 2

Describes subscripting with qualification.


{data-name-1 | condition-name} {IN | OF} data-name-2 [{IN | OF} data-name-3 ] ... ({subscript-1}...)

For a description of qualification with associated rules see the section "Qualification".

Syntax rules for both formats

  1. data-name-1 is the name of the table element. Its data description entry must either contain an OCCURS clause, or it must be subordinate to a data item which contains an OCCURS clause.

  2. subscript-1... may be represented by

    • an integer literal

    • a data-name with a positive integer as its value

    • relative subscripting

    • an arithmetic expression with a positive integer as its value

    • the word ALL.

    The data-name itself may be qualified but not indexed. ALL may be specified only if the subscripted identifier is specified as a function argument.

  3. One subscript must be specified for each OCCURS clause which is subordinate to data-name. Since a table may have up to seven dimensions, references to an element in a table may require up to seven subscripts.

  4. The subscript is enclosed in parentheses. The left parenthesis immediately follows the spaces after the name of the table element (data-name). When more than one subscript appears within a set of parentheses, these subscripts may be separated either by commas followed by at least one space, or by spaces only.

    In the case of relative subscripting, the operational signs between data-name and integer must also be delimited by spaces.

  5. The subscript, or set of subscripts, identifies the table element which is to be referenced. A data-name to which one or more subscripts have been added is called a subscripted data-name or identifier.

  6. When more than one subscript is used, they are entered proceeding from the outermost to the innermost table.

General rule for both formats

The subscript may contain a plus sign. The lowest valid subscript is 1. Consequently, neither zero nor negative numbers are permitted for subscripting. The highest allowable subscript value, in any particular case, is the maximum number of occurrences of the item, as specified in the OCCURS clause.