MONITOR command
The MONITOR command defines or redefines a command
and then displays the output in the monitor window (full-screen mode)
or log file (batch mode). The following commands are the only commands
you can use with the MONITOR command:
DESCRIBELISTNullQUERY
z/OS® Debugger maintains
a list of your most recently entered MONITOR commands.
Each command entered is assigned a number between 1 and 99 or you
can assign it a number. Use these numbers to indicate to z/OS Debugger which MONITOR command
you want to redefine.
GLOBAL- Specifies that the monitor definition is global. That is, it is not associated with a particular compile unit.
LOCAL- Specifies that the monitor definition is local to a specific compile
unit. Using z/OS Debugger,
the specified output is displayed only when the current qualification
is within the associated compile unit.
- cu_spec
- A valid compile unit specification. This specifies the compile unit associated with the monitor definition.
- integer
- An integer in the range 1 to 99, indicating what command in the list is replaced with the specified command and the order that the monitored commands are evaluated. If omitted, the next monitor integer is assigned. An error message is displayed if the maximum number of monitoring commands already exists.
- command
- A
DESCRIBE,LIST,Null, orQUERYcommand whose output is displayed in the monitor window or log file. - HEX
- Specifies that the value of the variable be displayed in hexadecimal
format. You can specify the
HEXparameter only with aMONITOR LIST expressioncommand or theMONITOR ncommand where n is the nth command in the MONITOR list and it must be aLIST expressioncommand. - DEFAULT
- Specifies that the value of the variable be displayed in its declared
data type. You can specify the
DEFparameter only with aMONITOR LIST expressioncommand or theMONITOR ncommand where n is the nth command in the MONITOR list and it must be aLIST expressioncommand.
Usage notes
- You can enter
HEXorDEFin the prefix area of the monitor window to display the selected line in hexadecimal or the default representation, respectively. - The
HEXandDEFprefix commands operate only on an individual structure element or array element when you enter them in the prefix area associated with that element. - A monitor number identifies a global monitor command, a local monitor command, or neither.
- Using z/OS Debugger, monitor output is presented in monitor number sequence.
- If a number is provided and a command omitted, a Null command is inserted on the line corresponding to the number in the monitor window. This reserves the monitor number.
- You can only specify a monitor number that is at most one greater than the highest existing monitor number.
- To clear a command from the monitor, use the
CLEAR MONITORcommand. - Replacement only occurs if the command identified by the monitor number already exists.
- When
SET AUTOMONITOR ONis in effect, z/OS Debugger adds an entry that is not visible after the last active entry in the monitor list. If you specify a number and it is either equal to or one more than the last active entry, z/OS Debugger inserts the newMONITORcommand in the last active entry and uses the next higher entry forSET AUTOMONITOR ON.Note: The
SET AUTOMONITOR ONcommand occupies 1 (for CURRENT or PREVIOUS) or 2 (for BOTH) entries in the monitor list. These entries are not included in the list of Monitor commands from theLIST MONITORcommand. - The
MONITOR LISTcommand does not allow thePOPUP,TITLED, andUNTITLEDoptions, exceptTITLED WSS. For more information about theTITLED WSSoption, see LIST expression command. If the Working-Storage Section contains large amounts of data, monitoring it can add a substantial amount of overhead and might produce unpredictable results. - When using the
MONITOR LISTcommand, simple references (or Clvalues) display identifying information with the values, whereas expressions and literals do not. - The
GLOBALandLOCALkeywords also affect the default qualification for evaluation of an expression.GLOBALindicates that the default qualification is the currently executing point in the program.LOCALindicates that the default qualification is to the compile unit specified. LOCALmonitors are suspended when the enclave containing the compile unit terminates or when the load module containing the compile unit is deleted. If the associated compile unit reappears later in the same debugging session, theLOCALmonitors are restored. However, because the original monitor number might be in use at that time, they will not always be restored with the same monitor number.- If the
DATAoption of thePLAYBACK ENABLEcommand is in effect for the current compile unit, you can use theMONITORcommand while you replay recorded statements by using thePLAYBACKcommands. - A
MONITOR LISTcommand can be evaluated only when the programming language currently in effect is the same as it was when theMONITOR LISTcommand was issued. Therefore, if the programming language is changed by one of the following actions, the evaluation of theMONITOR LISTcommand fails, and a message is displayed:- Suspending execution in a compile unit written in a language different
from the programming language that was in effect when the original
MONITORcommand was entered. - Entering the
SET PROGRAMMING LANGUAGEcommand. - Entering the
SET QUALIFYcommand. - Entering the
LOADDEBUGDATAcommand.
- Suspending execution in a compile unit written in a language different
from the programming language that was in effect when the original
- You can enter the
Mprefix command by using the Source window prefix area to add the variables on that line to the Monitor window. For the list of supported compile units, see M prefix (full-screen mode). - If one or more variables in the Monitor Local List expression is not defined in the specified compile unit, z/OS Debugger displays an error message and does not establish a MONITOR.
- If a duplicate
MONITORcommand is entered, z/OS Debugger ignores the command and issues a message that a duplicate command has been entered. If the commands are the same whenLIST MONITORis entered, they are considered to be duplicates; likewise, if they are different whenLIST MONITORis entered, they are considered unique.
Examples
- Replace the 10th command in the monitor list with
QUERY LOCATION. This is a global definition; therefore, it is always present in the monitor output.MONITOR 10 QUERY LOCATION; - Add a monitor command that displays the variable
abcand is local to compile unitmyprog. The monitor number is the next available number.MONITOR LOCAL myprog LIST abc;
Refer to the following topics for more information related to the material discussed in this topic.
