COBOL Manual for TNS and TNS/R Programs

Data Division
HP COBOL Manual for TNS and TNS/R Programs522555-006
7-80
OCCURS Clause for Fixed-Size Tables
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.
ASCENDING
DESCENDING KEY IS
key
VST105.vsd