ADDPGM (Add Program)
Purpose
The Add Program (ADDPGM) command adds 1 to 20 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 shown and changed.
When debugging one job from another job, debugging affects the running of the programs in the job being debugged, but not in the job doing the debugging. The user may run programs in a job doing the debugging, however, the programs will not be debugged.
Restrictions
- No more than 20 programs can be debugged at the same time.
- Two or more programs with the same name cannot be debugged at the same time.
- This command is valid only in debug mode. To start debug mode, see the Start Debug (STRDBG) command.
- This command cannot be used if the user is servicing another job, and that job is on a job queue, or is being held, suspended, or ended.
- This command cannot be used to add bound programs.
- The user must have either *CHANGE authority to the program, or *USE authority to the program and *SERVICE special authority.
Required Parameters
- PGM
- Specifies the qualified name of one or more programs being debugged. The number of programs specified here depends on how many programs are already being debugged; 20 is the maximum at any time. The user cannot debug two programs that have the same name.
The name of the program can be qualified by one of the following library values:
*LIBL: All libraries in the job's library list are searched until the first match is found.
*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
library-name: Specify the name of the library to be searched.
program-name: Specify the name of the program to be added for debugging.
Optional Parameters
- DFTPGM
- Specifies the name of 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 that specify *DFTPGM on their PGM parameter. That is, if a default program was previously specified, this parameter can change it.
*SAME: The value 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 on the PGM parameter of any other debug commands.
program-name: Specify the name of the program to use as the default program during debug mode. The same name must also be specified in the PGM parameter of this command or have been specified on the Start Debug (STRDBG) command or on a previous Add Program (ADDPGM) command.
Example for ADDPGM
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.
Error messages for ADDPGM
*ESCAPE Messages
- CPF1999
- Errors occurred on command.