Display Program References (DSPPGMREF)

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

The Display Program References (DSPPGMREF) command provides a list of the system objects referred to by the specified programs. The following list shows the system objects provided for the respective program types:

BASIC
*FILE (externally described) and *PGM
C
no information is provided for C-language programs except for ILE C-language programs (CLE)
CBLLE
*FILE, *PGM, and *SRVPGM
CL
*FILE, *PGM, and *DTAARA
CLE
*SRVPGM
CLLE
*FILE, *PGM, *DTAARA, and *SRVPGM
COBOL
*FILE and *PGM (literal names on CALL command)
CSP
*FILE, *PGM, *MSGF, *CSPMAP, and *CSPTBL
PASCAL
no information is provided for programs in PASCAL
PL/I
*FILE and *PGM
RPG
*FILE, *DTAARA, and *PGM
RPGLE
*FILE, *PGM, *DTAARA, and *SRVPGM

This information can be displayed, printed, or placed in a database output file.

If the information is shown or printed, a list (by library) of the specified user-authorized programs, along with the objects referenced by each program, is created. For files, information about how each file is used (input, output, update, unspecified, or any combination of these four) is also shown or printed.

If the information is written to a database file, the database file will have a record format named QWHDRPPR. The fields in record format QWHDRPPR are the same as the fields in the IBM-supplied format QWHDRPPR in file QADSPPGM in the library QSYS. The following information is contained in the database file:

For files, the record contains the following additional fields:

Note: This command lists which objects are referenced when the object is created or updated using UPDPGM or UPDSRVPGM. The referenced object names and libraries listed may be different than the actual names of the objects, since this information is stored when the program is created. Entries can be added as the ILE program or service program is updated using UPDPGM or UPDSRVPGM, but entries are never removed. If the object has been moved since the program was created, or an override was in effect during creation, the names listed may differ from the actual names.

Restrictions:

  1. The user must have object operational authority for the program.
  2. Also, of the libraries specified by the library qualifier, only the libraries for which the user has read authority are searched for the programs.
Top

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
OUTPUT Output *, *PRINT, *OUTFILE Optional, Positional 2
OBJTYPE Object type Single values: *ALL
Other values (up to 4 repetitions): *PGM, *SQLPKG, *SRVPGM, *MODULE
Optional
OUTFILE File to receive output Qualified object name Optional
Qualifier 1: File to receive output Name
Qualifier 2: Library Name, *LIBL, *CURLIB
OUTMBR Output member options Element list Optional
Element 1: Member to receive output Name, *FIRST
Element 2: Replace or add records *REPLACE, *ADD
Top

Program (PGM)

Specifies the name and library of the programs whose information is shown.

This is a required parameter.

The possible values for program name are:

program-name
Specify the full name of a program. Information is shown only for the specified program.
generic*-program-name
Specify a generic program name. Information is shown for all programs whose names begin with the specified characters.
*ALL
The information is shown for all programs in the library or libraries.

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*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   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.
*ALL
All libraries in the system, including QSYS, are searched.
name
Specify the name of the library to be searched.
Top

Output (OUTPUT)

Specifies whether the output from the command is displayed at the requesting work station or printed with the job's spooled output.

*
The output is displayed (if requested by an interactive job) or printed with the job's spooled output (if requested by a batch job).
*PRINT
The output is printed with the job's spooled output.
*OUTFILE
The output is directed to the database output file specified on the File to receive output prompt (OUTFILE parameter).
Top

Object type (OBJTYPE)

Specifies the object type for which information is displayed.

The possible values are:

*PGM
Only program information is displayed.
*ALL
Program information and SQL package information are displayed.
*SQLPKG
Only SQL package information is displayed.
*SRVPGM
Service program information is displayed.
*MODULE
Module information is displayed.
Top

File to receive output (OUTFILE)

Specifies the name and library of the database output file to which the output of the command is directed. If the file does not exist, this command creates a database output file in the specified library.

The possible library values are:

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is used to locate the file. If no current entry exists in the library list, QGPL is used.
library-name
Specify the name of the library where the file is located.

Note: The outfile format must be the same as QWHDRPPR of the system file QADSPPGM. More information on the OUTFILE format is in the Database information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter book.

Top

Output member options (OUTMBR)

Specifies the name of the database file member that receives the output of the command.

The possible values are:

*FIRST
The first member in the file receives the output. If no members exist in the file, the system creates a member with the name of the file specified in the File to receive output prompt (OUTFILE parameter).
member-name
Specify the name of the file member that receives the output. If the name does not exist, the system creates it.

The possible values for how information is stored are:

*REPLACE
The output data replaces any existing records in the specified file member.
*ADD
The output data is added to the end of existing records in the specified file member.
Top

Examples

Example 1: Storing a List of Programs

DSPPGMREF   PGM(LIBRARY1/*ALL)  OUTPUT(*OUTFILE)
            OUTFILE(LIB2/FILE2)

This command creates a list of all authorized programs found in LIBRARY1, and of the files and other system objects that the programs reference. It stores the list in a database file named FILE2 in LIB2.

Example 2: Printing a List of Objects

DSPPGMREF   PGM(LIBRARY1/BILLING)  OUTPUT(*PRINT)

This command creates a list of system objects that are referenced by the BILLING program in LIBRARY1. The output is spooled for printing.

Top

Error messages

*ESCAPE Messages

CPF3033
Object &1 in library &2 not found.
CPF3034
Object &1 in library &2 not displayed.
CPF3052
Description for file &1 not available.
CPF3061
Record format &3 not found for outfile &1.
CPF3063
Output file &1 in &2 not physical file.
CPF3064
Library &1 not found.
CPF3066
Error creating output file &1 in &2.
CPF3067
Error while opening file &1 in &2.
CPF3068
Error while writing to file &1 in &2.
CPF3069
Error while closing file &1 in &2.
CPF3070
Error creating member &3 in file &1.
CPF3072
File &1 in &2 is a system file.
CPF3074
Not authorized to library &1.
CPF3075
Library &1 not available.
CPF3076
Error occurred when on display.
CPF3077
Error occurred when canceling display.
CPF3084
Error clearing member &3 in file &1.
Top