CLEAR command

The CLEAR command removes the actions of previously entered z/OS® Debugger commands. Some breakpoints are removed automatically when z/OS Debugger determines that they are no longer meaningful. For example, if you set a breakpoint in a fetched or loaded compile unit, the breakpoint is discarded when the compile unit is released.

Read syntax diagramSkip visual syntax diagramCLEAR ATAT_commandgeneric_AT_commandDECLAREidentifier(,identifier)EQUATEidentifier(,identifier)LDD*number(,number)ldd_number_rangeLOADmodule_name(,module_name)LOGMEMORYMONITORnumber(,number)monitor_number_rangeCURSORONpli_condition(,pli_condition)PROCEDUREprocedure_name(,procedure_name)VARIABLESidentifier(,identifier) ;
AT
Removes all breakpoints, including GLOBAL breakpoints, set by previously entered AT commands, except for AT TERMINATION and suspended breakpoints.
AT_command
A valid AT command that includes at least one operand. The AT command must be complete except that the every_clause and command are omitted.
generic_AT_command
A valid AT command without operands. It can be one of the following: ALLOCATE, APPEARANCE, CALL, CHANGE, CURSOR, DATE, DELETE, ENTRY, EXIT, LABEL, LOAD, OFFSET, OCCURRENCE, PATH, STATEMENT (the LINE keyword can be used in place of STATEMENTS), or TERMINATION.
DECLARE
Removes previously defined variables and tags. If no identifier follows DECLARE, all session variables and tags are cleared. DECLARE is equivalent to VARIABLES.
identifier
The name of a session variable or tag declared during the z/OS Debugger session. This operand must follow the rules for the current programming language.
EQUATE
Removes previously defined symbolic references. If no identifier follows EQUATE, all existing SET EQUATE synonyms are cleared.
identifier
The name of a previously defined reference synonym declared during the z/OS Debugger session using SET EQUATE. This operand must follow the rules for the current programming language.
LDD
Removes one or more LOADDEBUGDATA (LDD) commands known to z/OS Debugger. The LDD command's sub-parameter must be one of those listed in the output of the LIST LDD command. It is recommended that you enter the LIST LDD command before each CLEAR LDD command because the LDD entry numbers are affected by previous CLEAR LDD commands. This command has the following sub-parameters:
*
Removes all LDD commands known to z/OS Debugger across all enclaves.
number
A positive integer that refers to the output of the LIST LDD command. If a list of integers is specified, all commands that are represented by the specified list are cleared.
ldd_number_range
Identifies the first and last number as seen in the LIST LDD command's output, separated by a hyphen (-), that you want to clear. When the current programming language setting is COBOL, blanks are required around the hyphen (-). Blanks are optional for other programming languages. However, in remote debug mode, blanks are required around the hyphen (-) for all programming languages.

Usage note

You can use the CLEAR LDD command in remote debug mode.

LOAD
Removes the load module. This command has the following sub-parameter:
module_name
The name of one or more load modules that were loaded by z/OS Debugger using the LOAD command.
LOG
Erases the log file and clears out the data being retained for scrolling. In line mode, CLEAR LOG clears only the log file.

If the log file is directed to a SYSOUT type file, CLEAR LOG will not clear the log contents in the file.

MEMORY
Clears the Memory window including the memory currently being displayed, the base address, and the history area.
MONITOR
Clears the commands defined for MONITOR. If no number follows MONITOR, the entire list of commands affecting the monitor window is cleared; the monitor window is empty.
number
A positive integer that refers to a monitored command. If a list of integers is specified, all commands represented by the specified list are cleared.
monitor_number_range
Identifies the first and last monitor number in a range of monitors, separated by a hyphen (-), that you want to delete. When the current programming language setting is COBOL, blanks are required around the hyphen (-). Blanks are optional for other programming languages.
CURSOR
Indicates that you want to delete the variable identified by the cursor’s current location. The cursor can be placed only in the Monitor window.
ON (PL/I)
Removes the effect of an earlier ON command. If no pli_condition follows ON, all existing ON commands are cleared.
pli_condition
Identifies an exception condition for which there is an ON command defined.
PROCEDURE
Clears previously defined z/OS Debugger procedures. If no procedure_name follows PROCEDURE, all inactive procedures are cleared.
procedure_name
The name given to a sequence of z/OS Debugger commands delimited by a PROCEDURE command and a corresponding END command. The procedure must be currently in storage and not active.
VARIABLES
Removes previously defined variables and tags. If no identifier follows VARIABLES, all session variables and tags are cleared. VARIABLES is equivalent to DECLARE.
identifier
The name of a session variable or tag declared during the z/OS Debugger session. This operand must follow the rules for the current programming language.

Usage notes

  • You can use the CLEAR AT command to clear either active or suspended breakpoints. However, you cannot use it to clear suspended label breakpoints.
  • If you want to clear a suspended breakpoint, you must specify both the load module and CU name.
  • You can use the CLEAR LOAD command in remote debug mode.
  • In some environments, a loaded module cannot be removed from storage. In this case the command fails and the load module remains in storage.
  • You can enter CL in the prefix area of the monitor window to clear the selected line in the Monitor window. You can enter CC prefix commands to clear a selected block of lines from the Monitor window.
  • You can use the CLEAR MONITOR n command to clear an automonitor entry in the Monitor window.
  • Only an AT LINE or AT STATEMENT breakpoint can be cleared with a CLEAR AT CURSOR command.
  • To clear every single breakpoint in the z/OS Debugger session, issue CLEAR AT followed by CLEAR AT TERMINATION.
  • To clear a global breakpoint, you can specify an asterisk (*) with the CLEAR AT command or you can specify a CLEAR AT GLOBAL command.

    If you have only a global breakpoint set and you specify CLEAR AT ENTRY without the asterisk (*) or GLOBAL keyword, you get a message saying there are no such breakpoints.

  • The CLEAR AT, CLEAR DECLARE, CLEAR LDD, CLEAR ON, and CLEAR VARIABLES commands cannot be used while you replay recorded statements by using the PLAYBACK commands.
  • To use the cursor to indicate which variable in the Monitor window to remove, do one of the following methods:
    • Assign the CLEAR MONITOR CURSOR to a PF key. Move the cursor to a variable in the Monitor window and press the PF key. This method is more convenient.
    • Type the CLEAR MONITOR command on the command line, then move the cursor to a variable in the Monitor window. Press Enter.
  • Based on the application flow and structure, the CLEAR LDD command might not take effect until the next z/OS Debugger session is started.
  • The CLEAR LDD * command removes all LDD commands known to z/OS Debugger across all enclaves.
  • Because the SAVEBPS data set is updated during each enclave exit, if at any time the CLEAR LDD command is issued afterwards, the LDD commands will have already been saved in the SAVEBPS data set and thus will be restored during the next debug session.
  • The SET EXPLICITDEBUG ON command takes precedence over the CLEAR LDD command. As a result, even though the CLEAR LDD command is processed, it will not undo the already processed LDD command.

Examples

  • Remove the LABEL breakpoint set in the program at label create.
    CLEAR AT LABEL create;
  • Remove previously defined variables x, y, and z.
    CLEAR DECLARE (x, y, z);
  • Remove the effect of the ninth command defined for MONITOR.
    CLEAR MONITOR 9;
  • Remove the structure type definition tagone (assuming all variables declared interactively using the structure tag have been cleared). The current programming language setting is C.
    CLEAR VARIABLES struct tagone;
  • Establish some breakpoints with the AT command and then remove them with the CLEAR command (checking the results with the LIST command).
    AT 50;
    AT 56;
    AT 55 LIST (r, c);
    LIST AT;
    CLEAR AT 50;
    LIST AT;
    CLEAR AT;
    LIST AT;
  • If you want to clear an AT ENTRY * breakpoint, specify:
    CLEAR AT ENTRY *;
    or
    CLEAR AT GLOBAL ENTRY;
  • If you want to remove the DATE breakpoint for block MYBLOCK, specify:
    CLEAR AT DATE MYBLOCK;
  • If you want to remove a generic DATE breakpoint, specify:
    CLEAR AT DATE *;
  • The following examples show how to display the LDD commands known to z/OS Debugger and how to use the CLEAR LDD command:

    • To display the LDD commands known to z/OS Debugger, specify:
      LIST LDD;
      Suppose that you get the following output:
      1. LDD TBND003::>TBND003A;
      2. LDD MYPROG;
      3. LDD MYPROG3;
      4. LDD PROG4::>PROG5;
      To remove all the LDD commands, specify:
      CLEAR LDD *;
      If you then enter the following command:
      LIST LDD;
      You will get the following result:
      There are no LDD commands established.
    • To display the LDD commands known to z/OS Debugger, specify:
      LIST LDD;
      Suppose that you get the following output:
      1. LDD 1A::>1AB;
      2. LDD PGM1C;
      To remove the LDD 1A::>1AB command, specify:
      CLEAR LDD 1;
    • To display the LDD commands known to z/OS Debugger, specify:
      LIST LDD;
      Suppose that you get the following output:
      1. LDD TBND005::>TBND005A;
      2. LDD MYPROG;
      3. LDD MYPROG5;
      4. LDD PROG5::>PROG5Y;
      If you then enter the CLEAR LDD 5 command, you will get the following output:
      No LDD command was established for LDD 5.
    • To display the LDD commands known to z/OS Debugger, specify:
      LIST LDD;
      Suppose that you get the following output:
      1.	LDD TBND003::>TBND003A;
      2.	LDD MYPROG;
      3.	LDD MYPROG3;
      4.	LDD PROG3::>PROG3C;
      If you then enter the CLEAR LDD (1,4) command, you will get the following output:
      Removes LDD TBND003::>TBND003A and LDD PROG3::>PROG3C
    • To display the LDD commands known to z/OS Debugger, specify:
      LIST LDD;
      Suppose that you get the following output:
      1.	LDD TBND003::>TBND003A;
      2.	LDD MYPROG;
      3.	LDD MYPROG3;
      4.	LDD PROG6::>PROG6F;
      If you then enter the CLEAR LDD 4 – 5 command (for COBOL or all languages in remote debug mode), you will get the following output:
      No LDD command was established for LDD 5.
      However, z/OS Debugger removes the LDD PROG6::>PROG6F command.

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