Rational Developer for System z
COBOL for Windows, Version 7.5, Language Reference


Variable-length tables

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

Format 2: variable-length tables
Read syntax diagramSkip visual syntax diagram>>-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

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)