How to create dynamic array in COBOL

2 posts / 0 new
Last post
Anonymous
How to create dynamic array in COBOL

 

Is it possible to create dynamic array in COBOl.
 
I have to declare an internal table in a cobol program, but
I do not know how much data it can hold. Is it possible to dynamically
adjust the size of the array?
"; ; ; ;
Anonymous
This is possible in COBOL

This is possible in COBOL using DEPENDING ON  clause.

 

   01  PATIENT-TREATMENTS.
       05  PATIENT-NAME                PIC X(30).
       05  NUMBER-OF-TREATMENTS        PIC 99 COMP-3.
       05  TREATMENT-HISTORY OCCURS 0 TO 50 TIMES
              DEPENDING ON NUMBER-OF-TREATMENTS.
           10  TREATMENT-DATE           PIC 9(8). 
           10  TREATING-PHYSICIAN       PIC X(30).

Log in or register to post comments
Sponsored Listing