Command reference / prog
ADDBKP
Add Breakpoint
Sets as many as ten breakpoints for a program in debug mode. At each selected location, control passes to the user or to a breakpoint handling program.
Allowed environments: *ALL.
Positional parameters: 5.
Parameters
STMT
Statement identifier
Sets the statement identifiers of one to ten statements or machine instructions in the program at which breakpoints are set. When run, the program breaks before processing a statement specified as a breakpoint.
PGMVAR
Program variables
Sets the names of up to ten program variables shown that are in a high-level language or machine instruction program. The name and the value of each program variable is shown when any of the breakpoints specified on the Statement identifier (STMT) parameter are reached. When run, the program stops before processing a statement specified as a breakpoint.
Suggested / special values:
*NONE
*NONE- No program variables are shown for any of the breakpoints specified.
*CHAR- This special value is specified instead of a variable name if a basing pointer is also specified. This special value displays a character view of a pointer to be shown without the use of a based variable.
character-value (program variable)- Enter the names of one to ten program variables, separated by blanks, shown when a breakpoint is reached. The name must be enclosed in apostrophes if it contains special characters.
character-value (basing pointer variable)- Enter up to five basing pointers for each program variable to be shown. In some languages, the program variable may be based on a pointer variable.
Elements in order
Program variable
Program variable
Suggested / special values:
*CHAR
Basing pointer variable
Basing pointer variable
START
Char output start position
Specifies, for string variables only, the starting position in the string from which its value is shown when the breakpoint is reached. If more than one string variable is specified for the Program variables (PGMVAR) parameter, the same starting position value is used for each one.
1- The variable is shown from the first position onward through the length specified by the value supplied for the Characters to display (LEN) parameter.
integer- Enter the first position of the program variable to be shown.
LEN
Characters to display
Specifies, for string variables only, the length of the string shown when the breakpoint is reached, starting at the position specified by the value supplied for the Char output start position (START) parameter. If more than one string variable is specified by the value supplied for the Program variables (PGMVAR) parameter, the same value is used for each one.
Suggested / special values:
*DCL
*DCL- The string variable is shown to the end of the string or for a value of 200 bytes, whichever is less. If the string variable has a maximum length of zero, the only allowable value for the LEN parameter is *DCL.
integer- Enter the length of the data shown.
OUTFMT
Output format
Sets the format used to show the variables.
Allowed values:
*CHAR, *HEX
*CHAR- Variables are shown in character form.
*HEX- Variables are shown in hexadecimal form.
PGM
Program
Sets the program to which the breakpoints are added.
Suggested / special values:
*DFTPGM
*DFTPGM- The breakpoints are added to the program currently specified as the default program in debug mode.
name- Enter the name of the program to which the breakpoints are added. The program must already be in debug mode.
SKIP
Skip value
Sets the number of times the statement or statements on the Statement identifier (STMT) parameter must be processed before the program is stopped.
0- The program stops immediately when the statement or statements are processed. No skipping of breakpoints is done.
integer- Enter the number of times the statements must be processed before the program is stopped. If more than one statement is specified, each statement will have its own independent skip value. There is a separate skip count for each statement.
BKPCOND
Breakpoint condition
Set a condition to evaluate before each statement listed in STMT. Program execution stops when the condition is true. Use *PGMVAR1 through *PGMVAR10 to refer to the variables listed in PGMVAR.
Suggested / special values:
*NONE
*NONE- Leave breakpoint expression unspecified.
breakpoint-expression- Enter a breakpoint expression indicating a conditional breakpoint. A breakpoint expression consists of these three parts: A variable (*PGMVAR1 to *PGMVAR10) An operator A compare value.
variable- Enter the variable to be used in the breakpoint expression. For example, *PGMVAR1 indicates the first variable of the Program variables (PGMVAR) parameter, *PGMVAR2 indicates the second, and so on.
operator- Enter what type of comparison is to be done for a conditional breakpoint.
*EQ- Equal to.
*NE- Not equal to.
*GT- Greater than.
*LT- Less than.
*GE- Greater than or equal to.
*NL- Not less than (same as *GE)
*LE- Less than or equal to.
*NG- Not greater than (same as *LE)
*CT- Contains.
compare-value- Enter a constant or another variable to compare with the first variable. If a constant is specified, it must be the same type as the variable. If the variable is numeric, the constant must be a number.
Elements in order
Variable
Variable
Allowed values:
*PGMVAR1, *PGMVAR2, *PGMVAR3, *PGMVAR4, *PGMVAR5, *PGMVAR6, *PGMVAR7, *PGMVAR8, *PGMVAR9, *PGMVAR10
Operator
Operator
Allowed values:
*EQ, *GT, *LT, *NE, *GE, *NL, *LE, *NG, *CT
Compare value or variable
Compare value or variable
BKPPGM
Breakpoint program to call
Enter the name of the user-supplied program (if any) to call when a breakpoint is reached in the program specified by the Program (PGM) parameter.
Suggested / special values:
*NONE
*NONE- No breakpoint-handling program is called when any breakpoint specified in this command is reached in the batch environment. The stopped program continues processing.
name (breakpoint program to call)- Enter the name of the user-supplied program to be called if any of the breakpoints on this command are reached while debugging in a batch environment.
*LIBL- Look in the thread's library list.
*CURLIB- The current library for the job is used to locate the program. If no library is specified as the current library for the job, QGPL is used.
name (library)- Enter the library where the program is located.
Qualified parts (object, then library; write LIBRARY/OBJECT)
Breakpoint program to call
Breakpoint program to call
Library
Library
Suggested / special values:
*LIBL, *CURLIB
Examples
ADDBKP STMT(150 RTN1 205) PGMVAR('&TEMP' '&INREC')
Establishes breakpoints at CL statement numbers 150 and 205 and at the label RTN1 for the default program in debug mode.
ADDBKP STMT(100) PGMVAR('AMOUNT(200)') PGM(MYPROG)
Assume in this example that MYPROG is a high-level language program being debugged in an interactive environment and that the program variable AMOUNT is a 250-element array in MYPROG.
ADDBKP STMT(10) SKIP(1000)
Causes the default program to stop when statement 10 is processed 1000 times (the breakpoint is skipped 1000 times).
ADDBKP STMT(10 20 30) SKIP(50)
Causes the default program to stop when statements 10, 20, and 30 are processed 50 times.
ADDBKP STMT(10) PGMVAR(X) BKPCOND(PGMVAR1 *EQ 5)
Stops the default program at statement 10 when variable X is equal to five.
ADDBKP STMT(20) PGMVAR((S1) (S2)) SKIP(100) BKPCOND(*PGMVAR1 *CT *PGMVAR2)
Stops after statement 20 has been processed 100 times, and then only if the character string S2 occurs in the character string S1.
Generated from os/cl/catalog/ADDBKP.json and os/cl/help/ADDBKP.json.