1 | Qualified user space name | Input | Char(20) |
2 | Format | Input | Char(8) |
3 | Qualified file name | Input | Char(20) |
4 | Member | Input | Char(10) |
5 | Record format | Input | Char(10) |
6 | Error code | I/O | Char(*) |
The List Database Relations (QDBLDBR) API 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. The information is placed in a user space specified by you.
Similar in function to the Display Database Relations (DSPDBR) command, this API allows more input parameter values than does the command. Also, your program can have more direct access to the information put in the user space by this API than when the command places similar information in an output file.
The information generated by this API replaces any existing information in the user space. It does not append information to any information already in the user space. If the space is bigger than needed, the contents of the remainder of the space are not changed. If the space is not big enough, it is extended.
The user space that is to receive the database relations information. The first 10 characters contain the user space name, and the second 10 characters contain the name of the library where the user space is located. You can use these special values for the library name:
*CURLIB | The job's current library |
*LIBL | The library list |
The content and format of the information to be returned about the specified file, member, or record format. One of the following format names must be used:
DBRL0100 | File information |
DBRL0200 | Member information |
DBRL0300 | Record format information |
For more information, see DBRL0100 Format (File), DBRL0200 Format (Member), or DBRL0300 Format (Record Format).
The name of the file for which database relations information is to be extracted. The first 10 characters contain the file name, and the second 10 characters contain the name of the library where the file is located. The file name cannot be a DDM file. The file name can be a specific file name, a generic name, or the following special value:
*ALL | All files |
You can use these special values for the library name:
*ALL | All libraries in the system |
*ALLUSR | All nonsystem libraries. For information on the libraries included, see *ALLUSR in Generic library names. |
*CURLIB | The job's current library |
*LIBL | The library list |
*USRLIBL | Libraries listed in the user portion of the library list |
The name of the member to be used for retrieving database relations for format DBRL0200. This value can be a specific member name, a generic member name, or one of the following special values:
*FIRST | Information about the first member (in the order created) in the specified file or files is to be provided. |
*LAST | Information about the last member (in the order created) in the specified file or files is to be provided. |
*ALL | Information about all members in the specified files is to be provided. |
This parameter is ignored for formats DBRL0100 and DBRL0300.
The name of the record format to be used for retrieving database relations for format DBRL0300. This value can be a specific record format, a generic record format, or the following special value:
*ALL | All record formats in the specified file |
This input is ignored for formats DBRL0100 and DBRL0200.
The structure in which to return error information. For the format of the structure, see Error Code Parameter.
The database relations list consists of an input parameter section and one of three possible formats for the list data section. The three formats are determined by the kind of information you are looking for. The format names are:
DBRL0100 | Database relations (file) |
DBRL0200 | Database relations (member) |
DBRL0300 | Database relations (record format) |
The layout of the contents of the user space is determined by the format used. The following tables show how the contents of the input parameter section and the data format sections are organized. For descriptions of each field, see Field Descriptions.
Offset | Type | Field | |
---|---|---|---|
Dec | Hex | ||
0 | 0 | CHAR(10) | User space name |
10 | A | CHAR(10) | User space library name |
20 | 14 | CHAR(8) | Format name |
28 | 1C | CHAR(10) | File name specified |
38 | 26 | CHAR(10) | File library name specified |
48 | 30 | CHAR(10) | Member name specified |
58 | 3A | CHAR(10) | Record format name specified |
The structure of the information returned is determined by the value specified for the format name. The DBRL0100 format includes information on files dependent on the file specified. The following table shows how this information is organized. For detailed descriptions of the fields in the list, see Field Descriptions.
Offset | Type | Field | |
---|---|---|---|
Dec | Hex | ||
0 | 0 | CHAR(10) | File name used |
10 | A | CHAR(10) | File library name used |
20 | 14 | CHAR(10) | Dependent file name |
30 | 1E | CHAR(10) | Dependent library name |
40 | 28 | CHAR(1) | Dependency type |
41 | 29 | CHAR(3) | Reserved |
44 | 2C | BINARY(4) | Join reference number |
48 | 30 | CHAR(10) | Constraint library name |
58 | 3A | BINARY(4) | Constraint name length |
62 | 3E | CHAR(258) | Constraint name |
The structure of the information returned is determined by the value specified for the format name. The DBRL0200 format includes information on files and members dependent on the file member specified. The following table shows how this information is organized. For detailed descriptions of the fields in the list, see Field Descriptions.
Offset | Type | Field | |
---|---|---|---|
Dec | Hex | ||
0 | 0 | CHAR(10) | File name used |
10 | A | CHAR(10) | File library name used |
20 | 14 | CHAR(10) | Member name used |
30 | 1E | CHAR(10) | Dependent file name |
40 | 28 | CHAR(10) | Dependent library name |
50 | 32 | CHAR(10) | Dependent member name |
60 | 3C | CHAR(1) | Dependency type |
61 | 3D | CHAR(3) | Reserved |
64 | 40 | BINARY(4) | Join reference number |
68 | 44 | BINARY(4) | Join file number |
72 | 48 | CHAR(10) | Constraint library name |
82 | 52 | BINARY(4) | Constraint name length |
86 | 56 | CHAR(258) | Constraint name |
The structure of the information returned is determined by the value specified for the format name. The DBRL0300 format includes information on files dependent on the record format specified. The following table shows how this information is organized. For detailed descriptions of the fields in the list, see Field Descriptions.
Offset | Type | Field | |
---|---|---|---|
Dec | Hex | ||
0 | 0 | CHAR(10) | File name used |
10 | A | CHAR(10) | File library name used |
20 | 14 | CHAR(10) | Record format name used |
30 | 1E | CHAR(10) | Dependent file name |
40 | 28 | CHAR(10) | Dependent library name |
Constraint library name. The name of the library containing the file to which the constraint applies.
Constraint name. The name of the constraint. This only applies when the dependency type is C.
Constraint name length. The length of the constraint name. Delimited names can be a maximum of 258 characters and non-delimited names a maximum of 128 characters.
Dependency type. How a file or member is related to the file or member specified with the QDBLDBR API. Possible values are:
blank | No dependent files or members were found for the specified file. |
C | Constraint. |
D | The dependent file or member is dependent on the data in the specified file or member that was extracted. |
I | The dependent file member is sharing the access path of the file that the information was extracted from. |
O | If an access path is shared, one of the file members is considered the owner. The owner of the access path is charged with the storage used for the access path. If the member displayed is designated the owner, one or more file members are designated with an I for access path sharing. |
V | The SQL view or member is dependent on the specified SQL view. |
Dependent file name. The name of the file that is dependent on the file specified using the QDBLDBR API. If no dependent files are found for the file specified, the dependent file name is *NONE.
Dependent library name. The name of the library that the dependent file is in. If there are no dependent files found for the file specified, the dependent library name is blank.
Dependent member name. The name of the file member that is dependent on the file member specified using the QDBLDBR API. If no dependent members are found for the member specified, the dependent member name is *NONE.
File library name specified. The name of the library containing the file for which the database relations information is requested.
File library name used. The name of the library containing the file used to extract the database relations information in this list entry.
File name specified. The name of the file for which the database relations information is to be extracted.
File name used. The name of the file used to extract the database relations information in this list entry.
Format name. The name of the format in which the database relations information is returned to the user space.
Join file number. If the file for which database relations information is being extracted is a join logical file, this is the ordinal number of the file in the JFILE to which the dependency relates. The join file number is zero if either of the following are correct:
Join reference number. If the dependent file listed is a join logical file, this is the ordinal number of the file in the JFILE to which this dependency relates. The join reference number is zero if either of the following are correct:
Member name specified. The name of the member for which the information is extracted.
Member name used. The name of the member used to extract the database relations information in this list entry.
Record format name specified. The name of the record format for which the information is displayed.
Record format name used. The name of the record format used to extract the database relations information in this list entry.
Reserved. An ignored field.
User space library name. The name of the library that contains the user space that receives the database relations information requested.
User space name. The name of the user space that receives the database relations information requested.
Message ID | Error Message Text |
---|---|
CPF3CF2 E | Error(s) occurred during running of &1 API. |
CPF3C21 E | Format name &1 is not valid. |
CPF3C23 E | Object &1 is not a database file. |
CPF3C90 E | Literal value cannot be changed. |
CPF326C E | File name &1 not valid special value. |
CPF326D E | Member name &1 not valid special value. |
CPF326E E | Record format name &1 not valid special value. |
CPF9872 E | Program or service program &1 in library &2 ended. Reason code &3. |
Top | Database and File APIs | APIs by category |