I ran into an interesting situation that I wanted to share with you. I had a program on an IBM mainframe. I was getting a user abend due to a table overflow. I got a LE formatted dump and went to see what the last few entries in my table were.
To make a long story shorter, the table was not expanded so I couldn't see any entries. The table was defined with OCCURS 0 to 200 TIMES DEPENDING ON (ODO) and the dependent variable was +201. That was expected because I used the following code:
To make a long story shorter, the table was not expanded so I couldn't see any entries. The table was defined with OCCURS 0 to 200 TIMES DEPENDING ON (ODO) and the dependent variable was +201. That was expected because I used the following code:
Code:
ADD +1 TO WS-TABLE-CNT
IF WS-TABLE-CNT > WS-TABLE-MAX
PERFORM 2190-USER-ABEND
END-IF
[\CODE]
Pretty standard stuff. I change the code to:
[code]
IF WS-TABLE-CNT < WS-TABLE-MAX
ADD +1 TO WS-TABLE-CNT
ELSE
PERFORM 2190-USER-ABEND
END-IF
[\CODE]
and the table formatted correctly in the dump. Obviously, LE is smart enough to know the object of the ODO is out of range so it doesn't attempt to expand the table AT ALL!
Guess I'll change my coding style so that I don't let ODO objects go out of range even if I'm going to abend the program.
Regards,
Glenn