VMS Help  —  COBOL  DATA_DIVISION, clauses  OCCURS  2format DEPENDING
  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} ... ]

1  –  min-times

  is an integer that specifies the minimum number of occurrences of a
  table element.  Its value must be greater than or equal to zero.

2  –  max-times

  is an integer that specifies the maximum number of occurrences of a
  table element.  Its value must be greater than min-times.

3  –  key-name

  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.

4  –  ind-name

  is an index-name.  It associates an index with the table and allows
  indexing in table element references.

5  –  depending-item

  is the data-name of an elementary unsigned integer data item.  Its
  value specifies the current number of occurrences.  Depending-item
  can be qualified.
Close Help