SET AUTOMONITOR command

Controls the monitoring of data items for the statement that z/OS® Debugger will run next, the most recent statement that z/OS Debugger ran, or both. The initial setting is OFF.

AUTOMONITOR works only for the following compile units:

  • COBOL or PL/I compile units compiled with the SYM suboption of the TEST compiler option. COBOL programs compiled with Enterprise COBOL for z/OS, Version 4.1 or later, or PL/I programs compiled with Enterprise PL/I Version 4.4 or later do not need the SYM suboption of the TEST compiler option.
  • assembler, disassembly, or LangX COBOL compile units
  • C/C++ compile units compiled with the z/OS 2.1 XL C/C++ compiler or later, with the DEBUG(FORMAT(DWARF)) compiler option.

The SET AUTOMONITOR command does not work for compile units written in any other language. In addition, the compile unit must be compiled or assembled with one of the following compilers or assemblers:

  • Enterprise COBOL for z/OS, Version 4 or later
  • Enterprise COBOL for z/OS and OS/390®, Version 3 Release 2 or later
  • Enterprise COBOL for z/OS and OS/390, Version 3 Release 1, with APAR PQ63235 installed
  • COBOL for OS/390 & VM, Version 2, with APAR PQ63234 installed
  • OS/VS COBOL, Version 1 Release 2.4
  • Enterprise PL/I for z/OS and OS/390, Version 3 Release 2 or later
  • High Level Assembler for MVS & VM & VSE, Version 1 Release 4 or later
  • Any compiler used to generate an EQALANGX file for LangX COBOL
  • z/OS 2.1 XL C/C++ compiler or later
Read syntax diagramSkip visual syntax diagramSETAUTOMONITOR ONNOLOGLOGCURRENTPREVIOUSBOTHOFF ;
ON
Enables monitoring of data items for the statement that z/OS Debugger will run next, the most recent statement that z/OS Debugger ran, or both. Specify the LOG suboption to save information in the log file.
OFF
Disables monitoring of all data items. Information is not saved in the log file.
LOG
Saves information in the log file.
NOLOG
Does not save information in the log file.
CURRENT
Monitor data items on the statement that z/OS Debugger will run next. This is the default.
PREVIOUS
Monitor data items on the most recent statement that z/OS Debugger ran.
BOTH
Monitor data items for the statement that z/OS Debugger will run next and the most recent statement that z/OS Debugger ran.

Usage notes

  • For Enterprise COBOL for z/OS Version 5, if a statement uses LENGTH OF <reference>, it is the length of the reference that is shown in the automonitor output, not the value of <reference>.
  • You can use this command in remote debug mode.
  • If the DATA option of the PLAYBACK ENABLE command is in effect for the current compile unit, you can use the SET AUTOMONITOR command while you replay recorded statements with the PLAYBACK commands. However, you cannot use the BOTH or PREVIOUS parameters.
  • If you enter the SET AUTOMONITOR ON LOG command for a compile unit that was compiled with a compiler that does not support automonitoring, then z/OS Debugger writes the breakpoint location into the log. This provides a record of the breakpoints encountered (breakpoint trace). No variable information is displayed.
  • To record the breakpoints encountered (breakpoint trace) in the log file, enter the following commands: SET AUTOMONITOR ON LOG; AT * GO;. For compile units compiled with a compiler that supports automonitoring, the statement location, the variable names, and the value of the variables are saved into the log. For other compile units, the statement location is saved into the log.
  • If you are debugging programs compiled with a PL/I compiler earlier than Enterprise PL/I for z/OS Version 3 Release 5, target variables are not listed. For example, in the following PL/I statement only J and its value is displayed:
    I = J + 1
  • For assembler and disassembly, z/OS Debugger displays only 32-bit general registers, floating-point registers, and storage operands. z/OS Debugger displays them in the following manner:
    • Register operands are displayed in numeric order.
    • Storage operands are displayed in the order S1, S2, and S4.
    • When the storage operand is a single symbol, the symbol name is displayed in the automonitor section of the Monitor window. Otherwise, the specified operand is displayed as a comment and the _STORAGE function is used to display the storage contents. For example, _STORAGE(X'1F3C8'::4)) is used to display a four-byte storage operand at address X'1F3C8'.
  • In an assembler compile unit, the SET AUTOMONITOR command provides information about a single machine instruction only. Even in the NOMACGEN view, SET AUTOMONITOR provides information about only one machine instruction and not all operands of the current macro invocation.
  • For LangX COBOL, array references are not included in the AUTOMONITOR output. In addition, when a statement is continued to subsequent lines, operands coded on continuation lines will not be displayed for VS COBOL II and Enterprise COBOL.
  • To disable monitoring of all data items, you can enter the SET AUTOMONITOR OFF or CLEAR MONITOR n commands, where n is the monitor number of an automonitor entry. You can also use CL prefix command on an entry in Monitor window.
  • In the AUTOMONITOR section of the Monitor window, z/OS Debugger displays the values of the variables in their declared data type. You can change this behavior in the following ways:
    • To display the value in hexadecimal format for one time, enter the HEX command in the prefix area of that item. When you step through your program, z/OS Debugger reverts the display to the declared data type.
    • To continuously display the value in hexadecimal format, enter one of the following commands:
      • MONITOR HEX n, where n is the monitor number of an entry in the AUTOMONITOR section. When you step through your program, z/OS Debugger displays the value of the variable in hexadecimal format until you enter the MONITOR DEF n command, where n is the same number you used for the MONITOR HEX command.
      • HEX in the prefix area of the AUTOMONITOR line (********** AUTOMONITOR **********. When you step through your program, z/OS Debugger displays the value of all the variables in the AUTOMONITOR section in hexadecimal format until you enter the DEF command in the prefix area of the AUTOMONITOR line.
  • Use the PREVIOUS and BOTH options while you step (by using the STEP command) through a program to see the values of a variables before and after a statement is run.
  • If you use The PREVIOUS or BOTH options and run through your program with the GO command, z/OS Debugger displays the value of a variable on the line that z/OS Debugger ran most recently, which might not be the line that you see in the Source window immediately before the current line.
  • When control is transferred between enclaves and any of the following settings are in effect, z/OS Debugger cannot determine the data from the previous enclave:
    • SET AUTOMONITOR ON LOG with PREVIOUS or BOTH
    • SET AUTOMONITOR ON NOLOG with PREVIOUS or BOTH
    z/OS Debugger displays a message.
  • You can list a single element of an array only for programs compiled with Enterprise PL/I for z/OS, Version 4 or later.

Refer to the following topics for more information related to the material discussed in this topic.