Skip to Content
Custom Search

How to create dynamic array in COBOL

1 reply [Last post]
Anonymous

 

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?
"; ; ; ;
Sponsored Listing
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).

Click the +1 button  below to share it with your friends and colleagues

 

Share this if you liked it!

 

Disclaimer



Who's online

There are currently 1 user and 33 guests online.

Online users

  • aritteGaiff
Dr. Radut | forum