Work with Programs (WRKPGM)

The Work with Programs (WRKPGM) command allows you to show a list of programs from one or more libraries.

Restrictions:

Parameters

Keyword Description Choices Notes
PGM Program Qualified object name Required, Positional 1
Qualifier 1: Program Generic name, name, *ALL
Qualifier 2: Library Name, *LIBL, *CURLIB, *USRLIBL, *ALLUSR, *ALL
PGMATR Program attribute *ALL, ASM38, BAS, BAS38, CBL, CBLLE, CBL36, CBL38, CLE, CLLE, CLP, CLP38, CPPLE, CSP, DFU, DFUEXC, DFUNOTEXC, FTN, PAS, PAS38, PLI, PLI38, RMC, RPG, RPGLE, RPG36, RPG38 Optional, Positional 2

Program (PGM)

Specifies the programs to be shown.

This is a required parameter.

Qualifier 1: Program

*ALL
All programs are shown.
generic-name
Specify the generic name of the programs to be shown. A generic name is a character string that contains one or more characters followed by an asterisk (*). If a generic name is specified, all programs that have names with the same prefix as the generic name are shown.
name
Specify the name of the program to be shown.

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched. All objects in these libraries with the specified object name are shown.
*CURLIB
The current library for the thread is searched. If no library is specified as the current library for the thread, the QGPL library is searched.
*USRLIBL
If a current library entry exists in the library list for the current thread, the current library and the libraries in the user portion of the library list are searched. If there is no current library entry, only the libraries in the user portion of the library list are searched.
*ALLUSR
All user libraries are searched. All libraries with names that do not begin with the letter Q are searched except for the following:

#CGULIB     #DSULIB     #SEULIB
#COBLIB     #RPGLIB
#DFULIB     #SDALIB

Although the following Qxxx libraries are provided by IBM, they typically contain user data that changes frequently. Therefore, these libraries are considered user libraries and are also searched:

QDSNX       QRCLxxxxx   QUSRDIRDB   QUSRVI
QGPL        QSRVAGT     QUSRIJS     QUSRVxRxMx
QGPL38      QSYS2       QUSRINFSKR
QMGTC       QSYS2xxxxx  QUSRNOTES
QMGTC2      QS36F       QUSROND
QMPGDATA    QUSER38     QUSRPOSGS
QMQMDATA    QUSRADSM    QUSRPOSSA
QMQMPROC    QUSRBRM     QUSRPYMSVR
QPFRDATA    QUSRDIRCF   QUSRRDARS
QRCL        QUSRDIRCL   QUSRSYS

  1. 'xxxxx' is the number of a primary auxiliary storage pool (ASP).
  2. A different library name, in the format QUSRVxRxMx, can be created by the user for each previous release supported by IBM to contain any user commands to be compiled in a CL program for the previous release. For the QUSRVxRxMx user library, VxRxMx is the version, release, and modification level of a previous release that IBM continues to support.
*ALL
All libraries in the system, including QSYS, are searched.
name
Specify the name of the library to be searched.

Program attribute (PGMATR)

Specifies whether only programs with a specific program attribute are shown.

*ALL
All programs specified for the Program (PGM) parameter are shown.
ASM38
Programs with the attribute ASM38 (System/38 Assembler programs) are shown. Programs with this attribute cannot be run on a IBM i.
BAS
Programs with the attribute BAS (BASIC programs) are shown.
BAS38
Programs with the attribute BAS38 (BASIC programs used in the System/38 environment) are shown.
CBL
Programs with the attribute CBL (original program model (OPM) COBOL programs) are shown.
CBLLE
Programs with the attribute CBLLE (integrated language environment (ILE) COBOL programs) are shown.
CBL36
Programs with the attribute CBL36 (COBOL programs used in the System/36 environment) are shown.
CBL38
Programs with the attribute CBL38 (COBOL programs used in the System/38 environment) are shown.
CLE
Programs with the attribute CLE (ILE C programs) are shown.
CLLE
Programs with the attribute CLLE (ILE control language (CL) programs) are shown.
CLP
Programs with the attribute CLP (OPM CL programs) are shown.
CLP38
Programs with the attribute CLP38 (CL programs used in the System/38 environment) are shown.
CPPLE
Programs with the attribute CPPLE (ILE C++ programs) are shown.
CSP
Programs with the attribute CSP (CSP/AE application programs) are shown.
DFU
Programs with the attribute DFU (data file utility (DFU) programs) are shown.
DFUEXC
Programs with the attribute DFUEXC (DFU programs which can be run in the System/38 environment) are shown.
DFUNOTEXC
Programs with the attribute DFUNOTEXC (System/38 DFU programs which cannot be run in the System/38 environment) are shown.
FTN
Programs with the attribute FTN (FORTRAN programs) are shown.
PAS
Programs with the attribute PAS (PASCAL programs) are shown.
PAS38
Programs with the attribute PAS38 (PASCAL programs used in the System/38 environment) are shown.
PLI
Programs with the attribute PLI (PL/I programs) are shown.
PLI38
Programs with the attribute PLI38 (PL/I programs used in the System/38 environment) are shown.
RMC
Programs with the attribute RMC (RM/COBOL-85 programs) are shown.
RPG
Programs with the attribute RPG (OPM RPG programs) are shown.
RPGLE
Programs with the attribute RPGLE (ILE RPG programs) are shown.
RPG36
Programs with the attribute RPG36 (RPG programs used in the System/36 environment) are shown.
RPG38
Programs with the attribute RPG38 (RPG programs used in the System/38 environment) are shown.

Examples

Example 1: Working with Control Language Programs

WRKPGM   PGM(MYLIB/*ALL)  PGMATR(CLP)

This command displays the Work with Programs panel, showing a list of all the programs with the attribute CLP (control language program) to which the user has some authority that are stored in library MYLIB.

Example 2: Working with Programs by Generic Name

WRKPGM   PGM(AB*)

This command displays the Work with Programs panel, showing a list of all programs in the library list that have names beginning with the letters 'AB'.

Error messages

*ESCAPE Messages

CPF9809
Library &1 cannot be accessed.
CPF9820
Not authorized to use library &1.