Display Data Base Relations (DSPDBR)

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

The Display Database Relations (DSPDBR) command provides relational information about database files. It identifies the physical and logical files dependent on a specific file, files that use a specific record format, or the file members that are dependent on a specific file member. The information can be displayed, printed, or placed in a database output file. This command does not apply to device files.

If the information is put in a database output file, the record format that is used is named QWHDRDBR. The fields in record format QWHDRDBR are the same as the fields in the IBM-supplied format QWHDRDBR in file QADSPDBR in the library QSYS. The following information is contained in the database output file:

Restrictions:

Top

Parameters

Keyword Description Choices Notes
FILE File Qualified object name Required, Positional 1
Qualifier 1: File Generic name, name, *ALL
Qualifier 2: Library Name, *LIBL, *CURLIB, *USRLIBL, *ALLUSR, *ALL
OUTPUT Output *, *PRINT, *OUTFILE 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
MBR Member Name, *NONE Optional, Positional 2
RCDFMT Record format Generic name, name, *NONE, *ALL Optional
Top

File (FILE)

Specifies the files about which relational information is shown, printed, or placed in an output file.

This is a required parameter.

Qualifier 1: File

*ALL
Information is provided for all files in the library or libraries.
name
Specify the full name of a file. Information is shown for this file only.
generic-name
Specify a generic file name. Information is provided for all database files whose names begin with the specified characters.

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   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.
Top

Output (OUTPUT)

Specifies where the output from the command is sent.

*
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 file specified for the File to receive output (OUTFILE) parameter.
Top

File to receive output (OUTFILE)

Specifies the database file to which the output of the command is directed. If the file does not exist, this command creates a database file in the specified library. If the file is created, the public authority for the file is the same as the create authority specified for the library in which the file is created. Use the Display Library Description (DSPLIBD) command to show the library's create authority.

Qualifier 1: File to receive output

name
Specify the name of the database file to which the command output is directed.

Qualifier 2: Library

*LIBL
The library list is used to locate the file. If the file is not found, one is created in the current library. If no current library exists, the file will be created in the QGPL library.
*CURLIB
The current library for the thread is used to locate the file. If no library is specified as the current library for the thread, the QGPL library is used.
name
Specify the name of the library to be searched.

Note: The outfile format must be the same as QWHDRDBR of system file QADSPDBR in the QSYS library. For more information on the outfile format, refer to Database category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.

Top

Output member options (OUTMBR)

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

Element 1: Member to receive output

*FIRST
The first member in the file receives the output. If OUTMBR(*FIRST) is specified and the member does not exist, the system creates a member with the name of the file specified for the File to receive output (OUTFILE) parameter. If the member already exists, you have the option to add new records to the end of the existing member or clear the member and then add the new records.
name
Specify the name of the file member that receives the output. If it does not exist, the system creates it.

Element 2: Replace or add records

*REPLACE
The system clears the existing member and adds the new records.
*ADD
The system adds the new records to the end of the existing records.
Top

Member (MBR)

Specifies the member in a database file whose dependent member information is shown, printed, or placed in an output file.

*NONE
No information about the file members is provided.
name
Specify the full name of the file member. Information for this particular file member is provided. If a member name is specified, a record format name cannot be specified for the Record format (RCDFMT) parameter.
Top

Record format (RCDFMT)

Specifies the record format for which dependent information is shown, printed, or placed in a database file. If this parameter is specified, a member name cannot be specified for the Member (MBR) parameter.

*NONE
No dependent record format information is provided.
*ALL
Information about all record formats in the specified files is provided.
name
Specify the full name of the record format. Information for this particular record format is provided.
generic-name
Specify a generic name. Information is provided for all record formats with names that begin with the specified characters.
Top

Examples

In the following examples, assume that there is an interactive environment and that the user of the command is authorized to access all relevant libraries and objects.

Example 1: Displaying Database Relations Information

DSPDBR   FILE(LIBRARY1/FILE1)  RCDFMT(FORMAT1)

This command shows a list of the names and database relations information for all files that use the FORMAT1 format and are associated with FILE1 in LIBRARY1. Because the environment is interactive, the output is shown at the work station running this command.

Example 2: Displaying Database Relations Information

DSPDBR   FILE(LIB1/FILE1)

This command shows database relations information for all files that are dependent on FILE1 in LIB1 for data sharing. It is shown at the work station running this command.

Example 3: Displaying Database Relations Information

DSPDBR   FILE(LIB1/FILE1)  MBR(MEMBER1)

This command shows database relations information for all members that are dependent on MEMBER1 in FILE1 in LIB1 for data sharing or access path sharing. They are shown at the work station running this command.

Top

Error messages

*ESCAPE Messages

CPF3010
No database files found for &1 in &2.
CPF3012
File &1 in library &2 not found.
CPF3014
No file specified as &1 in &2 can be displayed.
CPF3028
Record format &1 not found in file &2.
CPF3029
Member &1 not found in file &2 in &3.
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