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.
AT- Removes all breakpoints, including
GLOBALbreakpoints, set by previously enteredATcommands, except forAT TERMINATIONand suspended breakpoints.AT_command- A valid
ATcommand that includes at least one operand. TheATcommand must be complete except that the every_clause and command are omitted. generic_AT_command- A valid
ATcommand without operands. It can be one of the following:ALLOCATE,APPEARANCE,CALL,CHANGE,CURSOR,DATE,DELETE,ENTRY,EXIT,LABEL,LOAD,OFFSET,OCCURRENCE,PATH,STATEMENT(theLINEkeyword can be used in place ofSTATEMENTS), orTERMINATION.
DECLARE- Removes previously defined variables and tags. If no identifier follows
DECLARE, all session variables and tags are cleared.DECLAREis equivalent toVARIABLES.- 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 existingSET EQUATEsynonyms 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. TheLDDcommand's sub-parameter must be one of those listed in the output of theLIST LDDcommand. It is recommended that you enter theLIST LDDcommand before eachCLEAR LDDcommand because theLDDentry numbers are affected by previousCLEAR LDDcommands. This command has the following sub-parameters:- *
- Removes all
LDDcommands known to z/OS Debugger across all enclaves. - number
- A positive integer that refers to the output of the
LIST LDDcommand. 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 LDDcommand'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 LDDcommand 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
LOADcommand.
LOG- Erases the log file and clears out the data being retained for
scrolling. In line mode,
CLEAR LOGclears only the log file.If the log file is directed to a SYSOUT type file,
CLEAR LOGwill 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 followsMONITOR, 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
ONcommand 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
PROCEDUREcommand and a correspondingENDcommand. 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.VARIABLESis equivalent toDECLARE.- 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 ATcommand 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 LOADcommand 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
CLin the prefix area of the monitor window to clear the selected line in the Monitor window. You can enterCCprefix commands to clear a selected block of lines from the Monitor window. - You can use the
CLEAR MONITOR ncommand to clear an automonitor entry in the Monitor window. - Only an
AT LINEorAT STATEMENTbreakpoint can be cleared with aCLEAR AT CURSORcommand. - To clear every single breakpoint in the z/OS Debugger session,
issue
CLEAR ATfollowed byCLEAR AT TERMINATION. - To clear a global breakpoint, you can specify an asterisk (*)
with the
CLEAR ATcommand or you can specify aCLEAR AT GLOBALcommand.If you have only a global breakpoint set and you specify
CLEAR AT ENTRYwithout the asterisk (*) orGLOBALkeyword, you get a message saying there are no such breakpoints. - The
CLEAR AT,CLEAR DECLARE,CLEAR LDD,CLEAR ON, andCLEAR VARIABLEScommands cannot be used while you replay recorded statements by using thePLAYBACKcommands. - To use the cursor to indicate which variable in the
Monitor window to remove, do one of the following methods:
- Assign the
CLEAR MONITOR CURSORto 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 MONITORcommand on the command line, then move the cursor to a variable in the Monitor window. Press Enter.
- Assign the
- Based on the application flow and structure, the
CLEAR LDDcommand might not take effect until the next z/OS Debugger session is started. - The
CLEAR LDD *command removes allLDDcommands known to z/OS Debugger across all enclaves. - Because the
SAVEBPSdata set is updated during each enclave exit, if at any time theCLEAR LDDcommand is issued afterwards, theLDDcommands will have already been saved in theSAVEBPSdata set and thus will be restored during the next debug session. - The
SET EXPLICITDEBUG ONcommand takes precedence over theCLEAR LDDcommand. As a result, even though theCLEAR LDDcommand is processed, it will not undo the already processedLDDcommand.
Examples
- Remove the
LABELbreakpoint set in the program at labelcreate.CLEAR AT LABEL create; - Remove previously defined variables
x,y, andz.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
ATcommand and then remove them with theCLEARcommand (checking the results with theLISTcommand).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
LDDcommands known to z/OS Debugger and how to use theCLEAR LDDcommand:- To display the
LDDcommands known to z/OS Debugger, specify:LIST LDD;Suppose that you get the following output:
To remove all the1. LDD TBND003::>TBND003A; 2. LDD MYPROG; 3. LDD MYPROG3; 4. LDD PROG4::>PROG5;LDDcommands, specify:CLEAR LDD *;If you then enter the following command:
You will get the following result:LIST LDD;There are no LDD commands established. - To display the
LDDcommands known to z/OS Debugger, specify:LIST LDD;Suppose that you get the following output:
To remove the1. LDD 1A::>1AB; 2. LDD PGM1C;LDD 1A::>1ABcommand, specify:CLEAR LDD 1; - To display the
LDDcommands known to z/OS Debugger, specify:LIST LDD;Suppose that you get the following output:
If you then enter the1. LDD TBND005::>TBND005A; 2. LDD MYPROG; 3. LDD MYPROG5; 4. LDD PROG5::>PROG5Y;CLEAR LDD 5command, you will get the following output:No LDD command was established for LDD 5. - To display the
LDDcommands known to z/OS Debugger, specify:LIST LDD;Suppose that you get the following output:
If you then enter the1. LDD TBND003::>TBND003A; 2. LDD MYPROG; 3. LDD MYPROG3; 4. LDD PROG3::>PROG3C;CLEAR LDD (1,4)command, you will get the following output:Removes LDD TBND003::>TBND003A and LDD PROG3::>PROG3C - To display the
LDDcommands known to z/OS Debugger, specify:LIST LDD;Suppose that you get the following output:
If you then enter the1. LDD TBND003::>TBND003A; 2. LDD MYPROG; 3. LDD MYPROG3; 4. LDD PROG6::>PROG6F;CLEAR LDD 4 – 5command (for COBOL or all languages in remote debug mode), you will get the following output:
However, z/OS Debugger removes theNo LDD command was established for LDD 5.LDD PROG6::>PROG6Fcommand.
- To display the
Refer to the following topics for more information related to the material discussed in this topic.
