Hi. I have two tables defined in Working Storage:
WORKING-STORAGE SECTION.
01 WS.
05 W-CTE-BG4CPTST PIC X(8) VALUE 'BG4CPTST'.
05 W-RETURN-CODE PIC 99 VALUE ZEROES.
05 W-CNT PIC 9999 VALUE ZERO.
05 TABLA-A.
15 TABLA-A-ITEM OCCURS 100 TIMES.
20 T-A-FIELD PIC XX VALUE SPACES.
05 TABLA-B.
15 TABLA-B-ITEM OCCURS 100 TIMES.
20 T-B-FIELD PIC X VALUE SPACE.
I want to put some data to these tables, in this way:
MOVE 1 TO W-CNT
PERFORM UNTIL W-CNT > 100
MOVE 'B' TO TABLA-B-ITEM(W-CNT)
ADD 1 TO W-CNT
END-PERFORM
MOVE 1 TO W-CNT
PERFORM UNTIL W-CNT > 150
MOVE 'A' TO TABLA-A-ITEM(W-CNT)
ADD 1 TO W-CNT
END-PERFORM
As you see table TABLA-A isn't big enough for 150 items that I want to put in it.
My question is:
Is it normal that 50 'A's will go to TABLA-B? In this way I loose data in TABLA-B (they are overwriten).
I think I should get an ABEND.
What to do to avoid overwritting table TABLA-B?
Mayby it is about some compiler options?
TIA, Marek