Complex OCCURS DEPENDING ON

Several types of complex OCCURS DEPENDING ON (complex ODO) are possible. Complex ODO is supported as an extension to the 85 COBOL Standard.

The basic forms of complex ODO permitted by the compiler are as follows:

  • Variably located item or group: A data item described by an OCCURS clause with the DEPENDING ON phrase is followed by a nonsubordinate elementary or group data item.
  • Variably located table: A data item described by an OCCURS clause with the DEPENDING ON phrase is followed by a nonsubordinate data item described by an OCCURS clause.
  • Table that has variable-length elements: A data item described by an OCCURS clause contains a subordinate data item described by an OCCURS clause with the DEPENDING ON phrase.
  • Index name for a table that has variable-length elements.
  • Element of a table that has variable-length elements.

Example: complex ODO

Related references  
Effects of change in ODO object value  
OCCURS DEPENDING ON clause
(Enterprise COBOL for z/OS® Language Reference)