Batch RI load
The following figure. is displayed when you select Option L, Batch RI Load, from the Db2 Relationship Facilitator.
Use this screen to initiate a batch job that updates your Relationship file with referential integrity relationships (RI) for the specified Db2 subsystem.
Batch RI Load
COMMAND ===> SCROLL ===> CSR
Primary Commands: JCL view, GO to submit job
Line Commands: D Delete
Specify Batch Parameters:
Relationship File Name ===> 'TSOID01.FRSMP491.RELATION'
SSID ===> DSN Sysout Class ===> *
Filter List (optional):
Cmd Complete CREATOR ID
- ---------------------------------------------------
'
******************************* Bottom of data ********************************
On this screen you specify the Relationship file to be updated as well as the Db2 subsystem from which to load RI. Optionally, you can specify a list of Creator IDs to limit the relationships to only those that match the Creator IDs.
Enter GO to submit the job or enter JCL to review the JCL before submitting.
After you enter GO, File-AID/RDX displays the message: JOB SUBMITTED and returns to the Db2 Relationship Facilitator menu.
Specify Batch Parameters:
Relationship File Name
Specify the name of the Relationship file to be updated. If you don’t use quotes around the name, File-AID/RDX will add your TSO ID as the prefix.
SSID
Specify the subsystem ID of the Db2 subsystem from where you want to load RI.
Sysout Class
Specify the desired sysout class according to your site requirements (* is the default).
Filter List (optional):
Optionally, you can specify a list of Creator IDs to limit the relationships to be updated to only those that match the specified Creator IDs.
CMD
Enter valid line command (D). Note that the character ' indicates that the line is in Insert mode, ready for you to type in a Creator ID.
Complete CREATOR ID
Specify one Creator ID per line. Creator ID must be a complete ID. This field is scrollable (left/right) and subject to the EXPAND command to facilitate long Creator IDs. When you press Enter, a new line opens allowing you to enter an additional Creator ID.
Primary Commands
The following File-AID/RDX-specific primary commands are valid on this screen:
JCL
View the JCL for the Load RI utility (see also RI load Batch Job JCL). File-AID/RDX shows the Generated JCL panel where you review and modify the JCL. Enter the SUBMIT command to submit the Load RI job.
GO (G)
Submits this Load RI request without displaying the JCL. Before issuing the GO command, make sure you have specified the desired relationship file and Db2 subsystem. File-AID/RDX will also issue a message upon completion of the job.
Line Command
The following File-AID/RDX-specific line command is valid on this screen:
D (Delete)
Deletes the selected Creator ID from the list of Creator IDs.
Background Information
The RI load batch jobs update the relationship file (a VSAM-KSDS) with current referential integrity information by performing the following steps:
- Delete all referential integrity relationships (RI) for the subsystem specified from the relationship file.
- Gather new RI information, including non-enforced RI, from the Db2 catalog.
- Copy the new RI information to the relationship file.
The RI load batch job should be executed initially by the person responsible for installing File-AID/RDX. It can be executed periodically to refresh RI relationships in the relationship file. This is advantageous after structure changes, such as new or changed foreign keys, new or changed primary keys, and new tables.
To achieve the most efficient results, execute this job against a Db2 subsystem that contains single occurrences of tables. Usually, production, system test, and acceptance Db2 subsystems have single copies of tables. Conversely, test subsystems usually have many copies of tables and, therefore, would not be good Db2 subsystems against which to run the RI load batch job.
The referential integrity relationships that are loaded into the relationship file can be used as model definitions to generate a related table extract.
To ensure that a complete group of RI and AR related tables is extracted, specify the subsystem where application relationships were or are to be generated for tables using File-AID/RDX Relationship Facilitator option 3 - Add AR.
The following figure shows sample JCL.
RI load Batch Job JCL
//STEPLIB DD DSN=File-AID-Customized-load-library,DISP=SHR
// DD DSN=File-AID-Target-load-library
// DD DSN=Db2-load-library
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//RDXSQLCD DD SYSOUT=*
//RDXMLIB DD DSN=File-AID-message-library,DISP=SHR
//EXTPARMS DD DSN=TSOID01.prefix.PARMS.Dnnnnnn.Tnnnnnn.suffix,DISP=SHR
//RDXPARMS DD *
RELDSN ‘relationship-file’
CREATOR creator id
TBNAME table name
GO
CREATOR creator id
TBNAME table name
GO
XFREXEC is the File-AID/RDX program name.
The parameter information in the PARM field in the EXEC statement must have the following format:
Parameter | Default Value | Length | Description |
---|---|---|---|
Product | FR | 2 | FR : File-AID/RDX |
Option | 1 | 1 | File-AID/RDX option number. |
Operating Mode | B | 1 | B : Batch |
The following DD statements are required:
DD Statement | Description |
---|---|
STEPLIB | Customized and Target File-AID/RDX load libraries (CXVJLOAD and SXVJLOAD); Db2 load library. |
SYSOUT | Output class for error messages and reports. |
RDXSQLCD | Output class for detailed SQL error information from Db2. |
RDXMLIB | The library containing File-AID/RDX messages. |
EXTPARMS | File containing the load parameters (see EXTPARMS File). |
RDXPARMS | RELDSN -- The File-AID/RDX relationship file to be updated. |
Return Codes
An execution return code (RC) appears in the output listing. For return codes 4, 8, and 16, an error code and message indicating the specific problem also appear in the listing. In general, the return codes can be summarized as follows:
Return Code | Description |
---|---|
0 | Job ran to completion. |
4 | Job ran to completion with warning messages issued. |
8 | Job may have ended prematurely. Data set or Security related error. |
16 | Severe error, job aborted. |
Error Messages
As referential integrity information is loaded in the relationship file, error messages appear in the output listing. The following error messages can be ignored. They refer to the Db2 catalog tables, which do not always conform with the rules of referential integrity.
Relname: DSNAT
E170 The parent table does not have a primary index.
An error occurred loading the following relationship:
Relname: DSNVT
E171 Unable to determine the foreign key for the dependent table.
The first time you run the refresh job, the following error message is generated because the file is empty. It can be ignored.
Generated in AFOPEN called from line 103 of KOPEN(KOPEN)
Uninitialized VSAM file cannot be opened for input.
Interrupted while: Opening file "ddn:RDXRELDS"