Rational Developer for System z
Enterprise COBOL for z/OS, Version 4.1, Language Reference


Variable-length tables

Variable-length tables are specified using the OCCURS DEPENDING ON clause.

Read syntax diagramSkip visual syntax diagram
Format 2: variable-length tables

>>-OCCURS--+---------------+--integer-2--+-------+--DEPENDING--->
           '-integer-1--TO-'             '-TIMES-'              

>--+----+--data-name-1------------------------------------------>
   '-ON-'                

   .------------------------------------------------------.   
   V                                                      |   
>----+--------------------------------------------------+-+----->
     |                                  .-------------. |     
     |                                  V             | |     
     '-+-ASCENDING--+--+-----+--+----+----data-name-2-+-'     
       '-DESCENDING-'  '-KEY-'  '-IS-'                        

>--+-----------------------------------+-----------------------><
   |                  .--------------. |   
   |                  V              | |   
   '-INDEXED--+----+----index-name-1-+-'   
              '-BY-'                       

integer-1
The minimum number of occurrences.

The value of integer-1 must be greater than or equal to zero; it must also be less than the value of integer-2.

If integer-1 is omitted, a value of 1 is assumed and the keyword TO must also be omitted.

integer-2
The maximum number of occurrences.

integer-2 must be greater than integer-1.

The length of the subject item is fixed. Only the number of repetitions of the subject item is variable.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)