SET LOG command

Controls whether z/OS® Debugger writes each performed command and the resulting output to the log file and defines (or redefines) the name of the log file.

Read syntax diagramSkip visual syntax diagramSETLOGONONFILEfileidOLDMODOFFKEEPcount;
ON
Specifies that commands and output are written to the log file.
FILE fileid
Identifies the log file used. The FILE keyword cannot be abbreviated.

In non-CICS®, fileid is a DD name or a fully-qualified data set name. Partitioned data sets cannot be used.

In CICS, fileid is a fully-qualified data set name. The CICS region must have update authorization to the log file.

If fileid has the form of a DD name, z/OS Debugger checks to see if the file is allocated.

In full-screen mode, the log file should not be allocated to the 3270 terminal device.

OLD
Specifies that the new information is to replace any existing information in the specified file. This operand is ignored if fileid specifies a DD name.
MOD
Specifies that the new information is appended after any existing information in the specified file. This operand is ignored if fileid specifies a DD name.
KEEP count
Specifies the number of lines of log output retained for display. The initial setting is 1000; count cannot equal zero (0).
OFF
Specifies that commands and output are not written to a log file.

Usage notes

  • The following list describes how z/OS Debugger determines the initial setting for SET LOG:
    • If a default user log file was not specified through the EQAOPTS LOGDSN command, the following rules apply:
      • In a non-CICS environment, if you do not allocate INSPLOG DD, the initial setting is OFF.
      • In a non-CICS environment, if you do allocate INSPLOG DD, the initial setting is ON FILE INSPLOG.
      • In a CICS environment, the initial setting is OFF.
    • If a default user log file was specified through the EQAOPTS LOGDSN command, the following rules apply:
      • In batch mode, if you do not allocate INSPLOG DD, the initial setting is OFF.
      • In batch mode, if you do allocate INSPLOG DD, the initial setting is ON FILE INSPLOG.
      • In full screen mode and a non-CICS environment, if you do not allocate INSPLOG DD, the initial setting is ON FILE fileid. Specify fileid through the EQAOPTS LOGDSN command.
      • In full screen mode and a non-CICS environment, if you do allocate INSPLOG DD, the initial setting is ON FILE INSPLOG.
      • In a CICS environment, the initial setting is ON FILE fileid. Specify fileid through the EQAOPTS LOGDSN command.
  • If the EQAOPTS LOGDSN command was specified, then the EQAOPTS LOGDSNALLOC command can be specified to indicate that, if the log file data set does not exist, z/OS Debugger creates it. This can be used to create the file for new z/OS Debugger users.

    For existing z/OS Debugger users, if you use a SAVESETS data set, then the file contains a SET LOG command. If a specification for the EQAOPTS LOGDSN command is created after you have saved settings into your SAVESETS file, z/OS Debugger does not change your saved SET LOG command and does not create a new log file data set.

    To learn how to specify the EQAOPTS commands LOGDSN and LOGDSNALLOC, see EQAOPTS commands.

    FILE LOGDSN is used for the SET LOG ON command when both of the following conditions are true:
    • A SET LOG ON without a FILE fileid is issued when LOG is OFF.
    • ON FILE LOGDSN was used as the initial setting of SET LOG via the EQAOPTS LOGDSN command.

    For CICS, if you are not logged in or are logged in under the default user ID, z/OS Debugger does not create or use the file specified for fileid.

    For Db2® stored procedures, do not set up z/OS Debugger to create or use the file specified for fileid. Since multiple users share the same default data set, multiple users can attempt to write to the data set at the same time. In this environment, if LOGDSN is specified, specify NULLFILE for file-name-pattern.

  • The log output lines retained for display are always the last (that is, the most recent) lines.
  • Setting LOG OFF does not suppress the log display.
  • If you are debugging in full-screen mode and the log file is allocated to the terminal, issue a SET LOG OFF command before issuing a QUIT command. If you do not issue the SET LOG OFF command, the QUIT command fails.
  • Ensure that you allocate a log file big enough to hold all the log output from a debug session, because the log file is truncated after it becomes full. (A warning message is not issued before the log is truncated.)
  • For remote debug mode, you can only use the SET LOG ON and SET LOG OFF commands. The SET LOG ON command displays messages that explain why it stopped at the current location. The SET LOG ON command does not save the contents of the log to a permanent location. When the setting for SET LOG is OFF, messages related to breakpoints are not displayed. For example, the message Program was stopped due to line/statement breakpoint at statement 232. is not displayed.

    If you enter SET AUTOMONITOR ON LOG command, the SET LOG ON and SET LOG OFF commands are ignored. All messages are displayed.

Examples

  • Specify that commands and output are written to the log file named mainprog.
    SET LOG ON FILE mainprog;
    Another example using the data set name thing.
    SET LOG ON FILE userid.thing.log
  • Indicate that 500 lines of log output are retained for display.
    SET LOG KEEP 500;

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