COBOL Manual for TNS and TNS/R Programs
Data Fundamentals
HP COBOL Manual for TNS and TNS/R Programs—522555-006
4-20
Subscripts
Subscript Syntax
data-name
is either a data item described with an OCCURS clause or a data item subordinate
to a data item described with an OCCURS clause. If data-name is qualified, the
subscripts follow the qualifiers.
condition-name
is a level-88 item associated with either a data item described with an OCCURS
clause or a data item subordinate to a data item described with an OCCURS
clause. If condition-name is qualified, the subscripts follow the qualifiers.
subscript
integer
is a nonzero numeric literal. If it is signed, the sign must be positive.
qualified-name
is the identifier of an integer numeric data item. It can be qualified, but cannot
have subscripts or reference modifiers.
index-name
is the index in the INDEXED phrase of the OCCURS clause that describes
data-name. Its value is the occurrence number of an element in the
associated table. The program must initialize the value of an index-name
before using it in a subscript.
offset
is an unsigned integer numeric literal. Its value is added to (+) or subtracted
from (-) the value of qualified-name or index-name.
Example 4-7 shows subscripting for two 1-dimensional tables and a 2-dimensional
table.
condition-name
data-name ( )subscript
VST006.vsd
integer
qualified-name
index-name
+
offset
-
VST007.vsd