When component is numeric

If the component that is limiting the number of occurrences is numeric, create a component rule on the component that is identified with the ODO clause as described in this topic.

The following example represents two lines from a COBOL copybook:

            05 ORDREV_OUT_NUM_ACCTS PIC 9(04). 
05 ORDREV_OUT_ACCOUNT_INFO OCCURS 0 TO 1000 TIMES 
    DEPENDING ON ORDREV_OUT_NUM_ACCTS.
         
Add the following type tree component rule to the construct representing ORDREV_OUT_ACCOUNT_INFO:

            ORDREV_OUT_ACCOUNT_INFO 
RULE: COUNT($) <= ORDREV_OUT_NUM_ACCTS Field
         

When IBM Sterling Transformation Extender parses the data at run time, the ORDREV_OUT_NUM_ACCTS data field contains a numeric value. For this example, assume that at run time, the value of ORDREV_OUT_NUM_ACCTS is 50. That value will be used in the component rule: COUNT($) <= ORDREV_OUT_NUM_ACCTS Field , so COUNT($) <= 50.

When this rule is run, the first 50 occurrences of ORDREV_OUT_ACCOUNT_INFO are processed. IBM Sterling Transformation Extender determines any data that follows the data consumed as the 50 occurrences, to be the successive construct in the copybook.