Some COBOL compilers such as IBM one will assume that the minimum value of OCCURS DEPENDING ON
is 1 but nothing is enforcing that and
this behaviour can change or be different when using another compiler.
Setting the minimum value of OCCURS DEPENDING ON
makes the code more readable, and less dependent on compiler.
Noncompliant code example
01 MY-TABLE-COUNT PIC S9(4) BINARY.
01 MY-TABLE.
03 MY-ITEM OCCURS 500 TIMES *> Noncompliant
DEPENDING ON MY-TABLE-COUNT.
05 MY-FIELD-01 PIC X(08).
05 MY-FIELD-02 PIC 9(05).
Compliant solution
01 MY-TABLE-COUNT PIC S9(4) BINARY.
01 MY-TABLE.
03 MY-ITEM OCCURS 1 TO 500 TIMES *> Compliant; minimum value is 1
DEPENDING ON MY-TABLE-COUNT.
05 MY-FIELD-01 PIC X(08).
05 MY-FIELD-02 PIC 9(05).