Is there any way in Cobol to declare the array dyanamically. Because this time if you array size as 100, and later if this size has to be increased...all we need to do is change the size in the program. Instead is it possible to declare the array dynamically so that programs need not be changed later on for the size. So that program should allocate by itself dyanamically as much size as required.
the only way 2 declare a dyanamic array is thru using the depending clause
its format is as follows
The OCCURS DEPENDING ON clause specifies variable-length tables;All data-names used in the OCCURS clause can be qualified; they cannot be subscripted or indexed.
The following fragment from an invoice record demonstrates the concept:
05 ws-array PIC 99.
05 ws-array OCCURS 0 TO 25 TIMES
DEPENDING ON ws-array.
10 QUANTITY PIC 9999.
10 DESCRIPTION PIC X(30).
10 UNIT-PRICE PIC S9(5)V99