Add Program (ADDPGM)

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

The Add Program (ADDPGM) command adds one to twenty programs to the group of programs currently being debugged. When included in debug mode, the specified programs can have breakpoints and traces added to them for controlling and tracing their processing. The values of the programs' variables can also be displayed and changed.

When debugging one job from another job, debugging affects the running of the programs in the job being debugged, but not the job doing the debugging. You may run programs in a job doing the debugging, however, the programs will not be debugged.

Restrictions:

Top

Parameters

Keyword Description Choices Notes
PGM Program Values (up to 20 repetitions): Qualified object name Required, Positional 1
Qualifier 1: Program Name
Qualifier 2: Library Name, *LIBL, *CURLIB
DFTPGM Default program Name, *SAME, *NONE Optional, Positional 2
Top

Program (PGM)

Specifies one or more programs to be debugged. The number of programs specified here depends on how many programs are already being debugged; 20 is the maximum number of programs that can be debugged at the same time. You cannot debug two programs that have the same name at the same time.

This is a required parameter.

Qualifier 1: Program

name
Specify the name of the program to be debugged.

Qualifier 2: Library

*LIBL
The library list is used to locate the program to debug.
*CURLIB
The current library for the job is used to locate the program to debug. If no library is specified as the current library for the job, the QGPL library is used.
name
Specify the name of the library where the program is located.
Top

Default program (DFTPGM)

Specifies the 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.

*SAME
The program currently specified as the default program, if any, does not change.
*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 also be specified for the PGM parameter of this command or have been specified on the Start Debug (STRDBG) command or on a previous Add Program (ADDPGM) command.
Top

Examples

ADDPGM   PGM(QGPL/MYPROG)

This command adds the program MYPROG, located in the QGPL library, to the current debug mode. Breakpoints and traces can be put in MYPROG, and its variables can be displayed and changed by other debug commands. Because DFTPGM was not specified, the default program is not changed.

Top

Error messages

*ESCAPE Messages

CPF1999
Errors occurred on command.
Top