Consider the following characteristics of watches:
Watches are set on a system-wide basis, with a maximum number of 256 watches that can be active simultaneously. This number includes watches set by the system. If a variable crosses a page boundary, two watches are used internally to watch the storage locations. The maximum number of variables that can be watched simultaneously on a system-wide basis ranges from 128 to 256.
Depending on overall system use, you may be limited in the number of watches you can set at a given time. If you try to set a watch condition while the maximum number of active watches across the system is exceeded, you will receive an error message and the watch is not set.
Watches can only be set when a program is stopped under debug mode, and the variable to be watched is in scope. If this is not the case, an error message is issued when a watch is requested.
Once the watch is set, the address of a storage location watched does not change. If a watch is set on a temporary location, such as the automatic storage of an ILE C or C++ procedure, which can be reused after the procedure ends, it may result in invalid watch-condition notifications.
A watch condition may be registered although the watched variable is no longer in scope. You must not assume that a variable is in scope just because a watch condition is reported.
Two watch locations in the same job must not overlay in any way. Two watch locations in different jobs must not start at the same storage address; otherwise, overlap is allowed. If these restrictions are violated, an error message is issued.
After you have successfully set a watch, your application is stopped if a program in your session changes the contents of the watched storage location.
If the program has debug data, and a Source view is available, it is shown. The source line of the statement that is about to be run (when the content change at the storage location is detected) is highlighted. A message indicates which watch condition is satisfied.
If the program cannot be debugged, the text area of the display remains blank.
Programs with debug data are automatically added to the debug session if they cause the watch stop.
A watch breakpoint can be deleted, but not modified.