VMS Help
COBOL, DATA_DIVISION, clauses, OCCURS, 2format DEPENDING
*Conan The Librarian
|
The OCCURS clause defines tables and provides the basis for
subscripting and indexing. It eliminates the need for separate
entries for repeated data items.
Format 2 -
OCCURS min-times TO max-times TIMES DEPENDING ON depending-item
[ { ASCENDING } KEY IS {key-name} ... ] ...
[ { DESCENDING } ]
[ INDEXED BY {ind-name} ... ]
is an integer that specifies the minimum number of occurrences of a
table element. Its value must be greater than or equal to zero.
is an integer that specifies the maximum number of occurrences of a
table element. Its value must be greater than min-times.
is the data-name of an entry that contains the OCCURS clause or an
entry subordinate to it. Key-name can be qualified. Each key-name
after the first must name an entry subordinate to the entry that
contains the OCCURS clause. The values in each key-name are the
basis of the ascending or descending arrangement of the table's
repeated data.
is an index-name. It associates an index with the table and allows
indexing in table element references.
is the data-name of an elementary unsigned integer data item. Its
value specifies the current number of occurrences. Depending-item
can be qualified.