CDDLHELP.HLB  —  OCCURS_DEPENDING, Example
  In the following example, a variable length array defines  individual
  transactions within the STRUCTURE field SALES.

  SALES STRUCTURE.
      TRANSACTION_COUNT               DATATYPE IS UNSIGNED WORD
                                      VALID FOR DTR IF
                                          "TRANSACTION_COUNT > 0".
      TRANSACTION STRUCTURE           OCCURS 1 TO 99 TIMES
                                          DEPENDING ON
                                          TRANSACTION_COUNT.
          TRANS_DATE                  DATATYPE IS DATE.
          ORDER_NUMBER                DATATYPE IS UNSIGNED NUMERIC
                                      SIZE IS 10 DIGITS.
          AMOUNT                      DATATYPE IS UNSIGNED NUMERIC
                                      SIZE IS 8 DIGITS 2 FRACTIONS
                                      PICTURE FOR COBOL IS "9(6)V99".
      END TRANSACTION STRUCTURE.
  END SALES STRUCTURE.

  The   fully   qualified   field   name   of   TRANSACTION_COUNT    is
  SALES.TRANSACTION_COUNT.
Close Help