Change Debug (CHGDBG)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

The Change Debug (CHGDBG) command changes the attributes of the debugging session currently in effect for a job. All of the attributes can be changed, except which programs to debug. Use the Add Program (ADDPGM) command or the Remove Program (RMVPGM) commands to add or remove a program from debug mode.

Restrictions:

Top

Parameters

Keyword Description Choices Notes
DFTPGM Default program Name, *SAME, *NONE Optional, Positional 1
MAXTRC Maximum trace statements Integer, *SAME Optional
TRCFULL Trace full *SAME, *STOPTRC, *WRAP Optional
UPDPROD Update production files *SAME, *NO, *YES Optional
OPMSRC OPM source level debug *SAME, *NO, *YES Optional
Top

Default program (DFTPGM)

Specifies the original program model (OPM) program to use as the default program during debug mode. The program specified here is used as the default program for any of the other debug commands for which *DFTPGM was supplied for the Program (PGM) parameter. (That is, if a default program was previously specified, this parameter can change it.)

This parameter is applicable only in the OPM environment.

*SAME
The same program currently specified as the default program, if any, is used.
*NONE
No program is specified as the default program; if a program was specified as a default program, it is no longer the default program. If the job has no default program, *DFTPGM cannot be specified for the Program (PGM) parameter of any other debug commands.
name
Specify the name of the program to use as the default program during debug mode. The same name must have been specified for the PGM parameter of the Start Debug (STRDBG) or Add Program (ADDPGM) command.
Top

Maximum trace statements (MAXTRC)

Specifies the maximum number of trace statements that the system puts into the job's trace file before either stopping tracing or wrapping around (overlaying) on the trace file. When the trace file contains the maximum specified, the system performs the actions indicated by the value supplied for the Trace full (TRCFULL) parameter.

Note: Instruction stepping can be performed on a program being debugged in an interactive environment by setting the maximum number of trace statements to 1 and the value for the Trace full (TRCFULL) parameter to *STOPTRC.

This parameter is applicable only in the OPM environment.

*SAME
The maximum for the number of trace statements in the file is not changed.
integer
Specify the maximum number of trace statements that can be in the trace file.
Top

Trace full (TRCFULL)

Specifies what happens when the job's trace file is full, that is when it contains the maximum number of trace statements specified by the Maximum trace statements (MAXTRC) parameter.

This parameter is applicable only in the OPM environment.

*SAME
The action taken when the trace file is full is not changed.
*STOPTRC
In a batch environment, tracing stops but the program continues processing. In an interactive environment, control is given to the user when a breakpoint occurs. If the user continues processing, a breakpoint occurs before processing each subsequent statement within the range of statements being traced, and the trace file is extended to contain the new entry.
*WRAP
The trace file is overlaid with new trace statements as they occur, wrapping from the beginning of the file. The program continues processing until completed with no message to indicate that wrapping has occurred. The trace file never has more than the maximum specified statements, and they are the most recently recorded statements.
Top

Update production files (UPDPROD)

Specifies whether or not database files in a production library can be opened for changes (that is, for adding, deleting, or changing records in the file) while the job is in debug mode. If not, the files must be copied into a test library before trying to run a program that uses the files.

This parameter is applicable in both the OPM and ILE environments.

*SAME
The previously specified value for this parameter is not changed.
*NO
Database files in production libraries cannot be changed during debug mode. Database files can be opened for reading only.
*YES
Database files in production libraries can be changed while the job is in debug mode.
Top

OPM source level debug (OPMSRC)

Specifies whether OPM programs are debugged using the system source debug support (same as ILE source debug).

This parameter is valid for OPM CL, OPM RPG and OPM COBOL programs that were created with OPTION(*SRCDBG) with CRTCLPGM, CRTRPGPGM and CRTCBLPGM commands. Additionally, this parameter is valid for OPM CL, OPM RPG and OPM COBOL programs that were created with OPTION(*LSTDBG) with the CRTCLPGM, CRTRPGPGM, CRTCBLPGM CRTSQLRPG, CRTSQLCBL, and CRTRPTPGM commands. If the OPM program is not CL, RPG or COBOL and was not compiled with a valid debug option, then this parameter is ignored.

OPM programs already added to debug prior to the CHGDBG command will continue to be active under the debug environment (ILE or OPM) they are currently active under. Programs added to debug after the CHGDBG command is issued are affected by the OPMSRC parameter.

This parameter is applicable in both OPM and ILE environment.

*SAME
The value does not change.
*NO
OPM debug functions are used for OPM programs.
*YES
ILE debug functions are used for OPM programs.
Top

Examples

CHGDBG   MAXTRC(400)  TRCFULL(*STOPTRC)

This command changes the maximum number of trace statements that can be put in the trace file to 400. The tracing is stopped when the file is full.

Top

Error messages

*ESCAPE Messages

CPF1999
Errors occurred on command.
Top