Finding unexpected storage overwrite errors in PL/I
During program run time, some storage might unexpectedly change
its value and you want to find out when and where this happened.
Consider the following example where the program changes more than
the caller expects it to change.
2 FIELD1(2) CHAR(8);
2 FIELD2 CHAR(8);
CTR = 3; /* an invalid index value is set */
FIELD1(CTR) = 'TOO MUCH';
Find the address of FIELD2
with
the command: DESCRIBE ATTRIBUTES FIELD2
Suppose the result is X'00521D42'. To set a breakpoint that
watches for a change in storage values starting at that address for
the next 8 bytes, issue the command: AT CHANGE %STORAGE('00521D42'px,8)
When the program is run, z/OS® Debugger halts
if the value in this storage changes.