COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
max
is an integer literal that specifies the number of elements in the table.
key-order
determines whether the table elements are arranged in ascending or descending order of key
values.
key
is either the name of the entry containing the OCCURS clause or the name of an entry
subordinate to the entry containing the OCCURS clause.
index
is a name for a compiler-created item used to select an element from the table. Each index
must be unique in the program because you cannot qualify it.
Usage Considerations:
• The OCCURS Clause Describes a Table
The OCCURS clause specifies that the data-name with which it is associated (the one following
the level number in the same data description entry) identifies a table containing multiple
occurrences of the elementary item or data structure described by its entry. When the data
description entry does not define a name (that is, FILLER is specified either explicitly or
implicitly), the table is anonymous and its elements cannot be referred to directly. Except for
the OCCURS clause itself, all of the entry’s clauses apply to each occurrence of the item
described.
• The INDEXED Phrase Declares Index-Names
The presence of an INDEXED phrase serves also to declare one or more index-names for the
table. The names thus declared must not be separately declared elsewhere. These, and only
these, index-names can be used as the subscript when an index-name is used to select a
particular occurrence of this table.
• KEY Phrase
Each key (key in the syntax diagram) must reference a data item that is subordinate to the
table, except that the first key in a list can reference the table itself. No OCCURS clause can
212 Data Division










