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:

  1. To show each file specified, the user must have object operational authority for the file. Also, of the libraries specified by the library qualifier, only the libraries for which the user has *USE authority are searched for the files.

  2. To create an OUTFILE, the user must have *USE authority to the Create Physical File (CRTPF) command and *ADD authority to the library. To use an existing OUTFILE, the user must have operational (*OPR) and *ADD authority to the file.

  3. The user must have object management and delete authority also, if *REPLACE is specified.

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 name and library of the files about which relational information is shown, printed, or placed in an output file.

This is a required parameter.

The possible values for file names are:

file-name

Specify the full name of a file. Information is shown for this file only.

generic*-file-name

Specify a generic file name. Information is provided for all database files whose names begin with the specified characters.

*ALL

Information is provided for all files 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

 

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.

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

 

Member (MBR)

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

The possible values are:

*NONE

No information about the file members is provided.

member-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 on the Record format prompt (RCDFMT parameter).

Top

 

Record format (RCDFMT)

Specifies the name of 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 prompt (MBR parameter).

The possible values are:

record-format-name

Specify the full name of the record format. Information for this particular record format is provided.

generic*-record-format-name

Specify a generic name. Information is provided for all record formats with names that begin with the specified characters.

*NONE

No dependent record format information is provided.

*ALL

Information about all record formats in the specified files is provided.

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