Print Command Usage (PRTCMDUSG)

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

The Print Command Usage (PRTCMDUSG) command creates a cross-referenced listing of a specified group of CL commands that are used in a specified group of CL programs. The report shows, program by program, which of the specified commands are used in each program. The report can be used to identify which programs need to be recompiled because of changes that have been made to the command definition objects of commands specified on the PRTCMDUSG command. Note that this command can take a long time to run and can make a lot of printed output.

Top

Parameters

Keyword Description Choices Notes
CMD Command Values (up to 50 repetitions): Qualified object name Required, Positional 1
Qualifier 1: Command Name
Qualifier 2: Library Name, *LIBL
PGM Program Qualified object name Optional, Positional 2
Qualifier 1: Program Generic name, name, *ALL
Qualifier 2: Library Name, *USRLIBL, *CURLIB, *ALLUSR
Top

Command (CMD)

Specifies the names of up to fifty CL commands for which specified programs are searched and printed in a report. The system searches the specified programs for every occurrence of each command you specify.

Note: PRTCMDUSG cannot be used to print the command usage for ILE CL programs and modules.

This is a required parameter.

Qualifier 1: Command

name
Specify the name of a command.

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
name
Specify the name of the library that contains the CL commands whose usage in CL programs is to be reported.
Top

Program (PGM)

Specifies one or more CL programs that are searched for the specified commands. Only the programs and libraries for which you have some (any) authority are included in the report. This parameter also can specify that all (*ALL) programs in the specified library or libraries (*USRLIBL/*ALL, for example) are searched.

Qualifier 1: Program

*ALL
All CL programs in the specified library for which the user has some authority are searched to locate the specified CL commands.
generic-name
Specify the generic name of several programs in the specified library qualifier that are searched for the specified commands. A generic name can be specified as a character string that contains one or more characters followed by an asterisk (*).
name
Specify the name of the CL program that is to be searched for the specified CL commands.

Qualifier 2: Library

*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.
*CURLIB
The current library for the job is used to search for the CL program. If no library is specified as the current library for the job, QGPL is used.
*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   QUSRIJS     QUSRVxRxMx
QGPL        QSRVAGT     QUSRINFSKR
QGPL38      QSYS2       QUSRNOTES
QMGTC       QSYS2xxxxx  QUSROND
QMGTC2      QS36F       QUSRPOSGS
QMPGDATA    QUSER38     QUSRPOSSA
QMQMDATA    QUSRADSM    QUSRPYMSVR
QMQMPROC    QUSRBRM     QUSRRDARS
QPFRDATA    QUSRDIRCL   QUSRSYS
QRCL        QUSRDIRDB   QUSRVI

  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.
name
Specify the name of the library to be searched.
Top

Examples

PRTCMDUSG   CMD(CPYF)  PGM(PAYROLL/*ALL)

This commands searches all CL programs in the library PAYROLL for the Copy File (CPYF) commands and prints the names of both the commands and the program.

Top

Error messages

*ESCAPE Messages

CPF0593
PRTCMDUSG command ended by controlled end.
CPF0595
PRTCMDUSG command ended.
CPF0596
PRTCMDUSG command ended. Cannot open print file.
Top