COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

To make references unique, you can use qualifiers, subscripts, and reference modifiers. A data-name
made unique by a combination of qualifiers, subscripts, and reference modifiers is called an
identifier.
If an item in a record is tested frequently by a program, assigning a condition-name to the item is
a convenient way to refer to the item and show the significance of the item’s value. Assigning a
condition-name to the item is also good programming practice.
Topics:
Qualifiers
Subscripts
Reference Modifiers
Identifiers
Condition-Names
Qualifiers
When the name of a data element exists within a hierarchy of names, you must be able to make
references to the name unique by mentioning one or more names defined at higher levels of the
hierarchy. The higher-level names are called qualifiers. Although you must provide enough qualifiers
to make the name unique, you need not include all levels. For more information on qualifiers, see
Qualified Names (page 67).
Subscripts
A subscript, or set of subscripts, identifies an element in a table (created by an OCCURS clause).
Whenever a statement in the Procedure Division refers to an individual table element or any item
subordinate to a table element, that reference must include a subscript.
If the data item belongs to a table nested within one or more other tables (because more than one
OCCURS clause applies to the data-name), a reference to the data item must include a subscript
corresponding to each table (except in SEARCH statements and some intrinsic functions, which do
not allow subscripts).
If a condition-name is associated with a data item for which subscripts are required, a reference
to that condition-name must also include appropriate subscripts.
NOTE: A program that executes on TNS or TNS/R processors can use indexes instead of
subscripts, which might be more efficient. For more information, see the COBOL Manual for TNS
and TNS/R Programs. For the ECOBOL compiler, there is no difference between indexes and
subscripts.
Topics:
Subscript Syntax
Number and Range of 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.
90 Data Fundamentals