The following example uses an OCCURS DEPENDING ON:
03 NUMBER-OF-STYLES PIC 99. 03 STYLE-STORAGE OCCURS 1 TO 9 TIMES DEPENDING ON NUMBER-OF-STYLES INDEXED by STYLE-I1 05 FIELD-A ... 05 FIELD-B ... 03 FIELD-C ...
Some application files describe data arrays with an OCCURS clause without the DEPENDING ON phrase. However, the files have uninitialized or otherwise invalid data in some of the occurrences.
Because of the limitations on the use of the DEPENDING ON phrase, the COBOL Procedure Division statements test the data item NUMBER-OF-STYLES to limit the occurrences used. If this is the case, the DEPENDING ON item must be identified.