CL Command Reference - DSPPGMREF
CL Command List > DSPPGMREF Reference
Description:
The Display Program References (DSPPGMREF) command provides a list of the system objects referred to by the specified programs.
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:
. The name of the program and its text description
. The name of the library containing the program
. The number of objects referenced by the program
. The qualified name of the system object
. The information retrieval dates
. The object type of the referenced object
For files, the record contains the following additional fields:
. The name of the file in the program (possibly different from the system object name if an override was in effect when the program was created)
. The program use of the file (1=input, 2=output, 4=update, 8=unspecified, or a number representing a combination of any of these four; for example, a code of 11 is a combination of 1, 2, and 8, which is input, output, and unspecified)
. The number of record formats referenced, if any
. The name of the record format used by the file and its record format level identifier
. The number of fields referenced for each format
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.
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.