Command reference / db
DSPDBR
Display Data Base Relations
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: For each file specified in the command, the database record contains: The name of the specified file, its library name, and the file type of the specified file The name of the record format used for the file, if a name is specified for RCDFMT The information retrieval date(s) for the file information; the latest date contains the most accurate information, if changes have been made to the files One of the following is also included in the record: The names of all the files that are dependent on the specified file for access path sharing or data sharing; the names of the libraries containing the files and the type of sharing are also included The names of all the file members that are dependent on the specified member, their library names, and the type of sharing The names of all the files that are dependent on the specified record format, and their library names.
Allowed environments: *ALL.
Positional parameters: 2.
Restrictions
- To show each file specified, you must have object operational (*OBJOPR) authority for the file. Also, of the libraries specified by the library qualifier, only the libraries for which the user has execute (*EXECUTE) authority are searched for the files.
- To create an OUTFILE, you must have *USE authority to the Create Physical File (CRTPF) command and add (*ADD) authority to the library. To use an existing OUTFILE, the user must have *OBJOPR and *ADD authority to the file.
- You must have object management (*OBJMGT) and delete (*DLT) authority if *REPLACE is specified for the outfile member and the file member already exists.
Parameters
FILE
File
Specifies the files about which relational information is shown, printed, or placed in an output file. This is a required parameter.
*ALL (File)- Information is provided for all files in the library or libraries.
name (File)- 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.
*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 QWQCENT QMGTC QSYS2xxxxx QUSRNOTES QWQREPOS QMGTC2 QS36F QUSROND QMPGDATA QUSER38 QUSRPOSGS QMQMDATA QUSRADSM QUSRPOSSA QMQMPROC QUSRBRM QUSRPYMSVR QPFRDATA QUSRDIRCF QUSRRDARS QRCL QUSRDIRCL QUSRSYS 'xxxxx' is the number of a primary auxiliary storage pool (ASP). 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 (Library)- All libraries in the system, including QSYS, are searched.
name (Library)- Specify the name of the library to be searched.
Qualified parts (object, then library; write LIBRARY/OBJECT)
File
File
Suggested / special values:
*ALL
Library
Library
Suggested / special values:
*LIBL, *CURLIB, *USRLIBL, *ALLUSR, *ALL
MBR
Member
Specifies the member in a database file whose dependent member information is shown, printed, or placed in an output file.
Suggested / special values:
*NONE
*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.
OUTPUT
Output
Specifies where the output from the command is sent.
Allowed values:
*, *PRINT, *OUTFILE
*- 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.
RCDFMT
Record format
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.
Suggested / special values:
*NONE, *ALL
*NONE- No dependent record format information is provided.
*ALL- Information about all shared 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.
OUTFILE
File to receive output
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. 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/.
name (File to receive output)- Specify the name of the database file to which the command output is directed.
*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 (Library)- Specify the name of the library to be searched.
Qualified parts (object, then library; write LIBRARY/OBJECT)
File to receive output
File to receive output
Library
Library
Suggested / special values:
*LIBL, *CURLIB
OUTMBR
Output member options
Specifies the name of the database file member that receives the output of the command.
*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.
*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.
Elements in order
Member to receive output
Member to receive output
Suggested / special values:
*FIRST
Replace or add records
Replace or add records
Allowed values:
*REPLACE, *ADD
Examples
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.
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.
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.
Generated from os/cl/catalog/DSPDBR.json and os/cl/help/DSPDBR.json.