DSPDBR (Display Database Relations) Command Description
Purpose
The Display Database Relations (DSPDBR) command gives relational information about database files. The information identifies the physical and logical files that are dependent on a specific file, files that use a specific record format, or file members that are dependent on a specific file member. This command is used to display or print the information, or to place the information in a database output file (an OUTFILE). 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
Restrictions:
- 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.
- 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.
- The user must have object management and delete authority also, if *REPLACE is specified.
Required Parameter
- FILE
- Specifies the qualified name of the database file or the generic name of several database files about which relational information is shown. This parameter can also specify that all files in the specified library or libraries (*LIBL/*ALL, for example), or all files in all libraries (*ALL/*ALL), have relational information about them shown. Only the libraries in the specified library qualifier that the user either owns or is authorized to use are searched for the files.
The name of the file can be qualified by one of the following library values:
*LIBL: All libraries in the job's library list are searched until the first match is found.
*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
*USRLIBL: Only the libraries in the user portion of the job's library list are searched.
*ALL: All libraries in the system, including QSYS, are searched.
library-name: Specify the name of the library to be searched.
*ALL: All files in the specified library (or in all libraries identified in the library qualifier to which the user has access) have their relational information shown.
generic*-file-name: Specify the name of the database file or the generic name of several database files in the specified library qualifier that have relational information shown. A generic name is a character string of one or more characters followed by an asterisk (*); for example, ABC*. The asterisk substitutes for any valid characters. A generic name specifies all objects with names that begin with the generic prefix for which the user has authority. If an asterisk is not included with the generic (prefix) name, the system assumes it to be the complete object name. For more information on the use of generic names, refer to generic names.
file-name: Specify the full name of the database file that has its relational information shown.
Optional Parameters
- MBR
- Specifies the name of the member in a database file whose dependent information is shown, printed, or placed in a database file.
*NONE: No information about the file member's relations is provided. File relations or record format relations are provided.
member-name: Specify the name of the database file member whose relations information is provided. If a member name is specified, either one file name or a generic file name must be specified. If MBR is specified, RCDFMT cannot be specified.
- RCDFMT
- Specifies the name of the record format of the database file member whose relations information is provided. If RCDFMT is specified, MBR cannot be specified.
*NONE: No record format relations information is provided.
*ALL: Relations information about all record formats in the specified files is provided.
record-format-name: Specify the full name of the record format whose relations information is provided.
generic*-record-format-name: Specify the generic name of the record format or several record formats in the specified files whose relations information is provided. A generic name is a character string of one or more characters followed by an asterisk (*); for example, ABC*. The asterisk substitutes for any valid characters. A generic name specifies all objects with names that begin with the generic prefix for which the user has authority. If an asterisk is not included with the generic (prefix) name, the system assumes it to be the complete object name. For more information on the use of generic names, refer to generic names.
- OUTPUT
- Specifies whether the output from the command is shown at the requesting work station, printed with the job's spooled output, or placed in a database file. More information on this parameter is in commonly used parameters.
*: Output requested by an interactive job is shown on the display. Output requested by a batch job is printed with the job's spooled output.
*PRINT: The output is printed with the job's spooled output on a printer.
*OUTFILE: The output is sent to the database file specified on the OUTFILE parameter.
- OUTFILE
- Specifies the qualified name of the database output file where the specified relational information is stored. If the specified file does not exist, the system creates a database file and member in the specified library.
When creating the database output file, the current date, time, and system name must be included. The system name is the name of the source system, not the target system.
If the file is created, the text is "Outfile for DSPDBR" and the public authority is *EXCLUDE.
Note: The outfile format must be the same as QWHDRDBR of system file QADSPDBR in the QSYS library. The name of the database output file can be qualified by one of the following library values:
*LIBL: All libraries in the job's library list are searched until the first match is found.
*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
library-name: Specify the name of the library to be searched.
database-file-name: Specify the name of the database file where the relational information is stored. If the specified file is not found, a file and a file member are created in the specified library, or in the current library if its name is not qualified. This file can be used when other DSPDBR commands are entered. The IBM-supplied database file, QADSPDBR, cannot be specified.
- OUTMBR
- Specifies the name of the database file member to which the output is directed.
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 in the OUTFILE parameter.
member-name: Specify the name of the file member that receives the output. If OUTMBR(member-name) is specified and the member does not exist, the system creates it. If the member exists, the user has the option to add records to the end of the existing member or to clear the existing member before adding the new records.
Element 2: Operation to Perform on Member
*REPLACE: If a member exists, the system clears it and adds the new records.
*ADD: If a member exists, the system adds the new records to the end of the existing records.
Examples for DSPDBR
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.
Additional Considerations
When the DSPDBR command is entered, the database is searched for the specified relationships and a record is generated for each relationship (dependency) that is found. The records are placed in the printer device file named QPDSPDBR. If OUTPUT(*PRINT) is specified on the command, the records are listed on the printer in the following order:
- Header information, which lists the DSPDBR command input values and the files identified in the database that match the command's request.
- The names of the files that are dependent on the files identified by the FILE parameter. A file can be dependent on another file for its access path or its data. This information is listed when neither MBR nor RCDFMT is specified.
- If a member name was specified in the MBR parameter, the names of the file members that are dependent on a member in the file (a member can be dependent on another member for its access path or its data).
- The names of the database files that are dependent on a record format of the specified files, if a record format name was specified in the RCDFMT parameter.
If the DSPDBR command is entered interactively and OUTPUT(*) is specified or assumed, the records in the printer device file are shown instead of printed.
Error messages for DSPDBR
*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.