Need help in handling one nested OCCURS array (variable length).
The first array has an element, which holds the number of occurrence for the second array. But this is not getting accepted in COBOL. Please help on this.
01 COUNT-1 PIC 9(3).
01 TABLE-1.
05 PHONE-DATA-1 OCCURS 0 TO 25 TIMES
DEPENDING ON COUNT-1.
10 PHONE-SUB-DATA-S.
15 COUNT-2 PIC S9(9) COMP-5 SYNC.
15 TABLE-2.
20 PHONE-DATA-2 OCCURS 0 TO 25 TIMES
DEPENDING ON COUNT-2.
25 PHN-NUM PIC X(10).
ERROR DESC:
IGYGR1263-S "OCCURS DEPENDING ON" OBJECT "COUNT-2" WAS DEFINED AS
TABLE ELEMENT. THE "DEPENDING ON" PHRASE WAS DISCARDED.
TABLE ELEMENT. THE "DEPENDING ON" PHRASE WAS DISCARDED.
I tried the following in the second array, even then it failed
20 PHONE-DATA-2 OCCURS 0 TO 25 TIMES
DEPENDING ON COUNT-2(COUNT-1).
DEPENDING ON COUNT-2(COUNT-1).
ERROR DESC:
IGYDS1089-S "(" WAS INVALID. SCANNING WAS RESUMED AT THE NEXT AREA "A" ITEM,
LEVEL-NUMBER, OR THE START OF THE NEXT CLAUSE.
IGYGR1263-S "OCCURS DEPENDING ON" OBJECT "COUNT-2" WAS DEFINED AS
TABLE ELEMENT. THE "DEPENDING ON" PHRASE WAS DISCARDED.
LEVEL-NUMBER, OR THE START OF THE NEXT CLAUSE.
IGYGR1263-S "OCCURS DEPENDING ON" OBJECT "COUNT-2" WAS DEFINED AS
TABLE ELEMENT. THE "DEPENDING ON" PHRASE WAS DISCARDED.