Using relationship definitions across Db2 subsystems
The relationship file contains information about referential integrity relationships and application-defined relationships. When File-AID/RDX searches for relationship information, it conducts the search based on the names of the tables in the relationships. When File-AID/RDX cannot find an exact match in the relationship data set, it continues looking for definitions that match the table name only. Since it does not use the location, subsystem, or creator name, File-AID/RDX can use relationship information from any subsystem for any other subsystem. As a result, you do not have to define relationships for tables in your subsystem, but rather you can copy data to your subsystem based on a relationship from another subsystem.
The following scenario illustrates the process of how to extract data from one subsystem using relationship information from a second subsystem to populate tables in a third subsystem. In the following table, there are three different subsystems (PROD, TEST, and ACCEPT). Each entry in the columns represents the name of a table.
Db2 Subsystems
PROD | ACCEPT | TEST |
---|---|---|
P.CUSTOMER | A.CUSTOMER | T.CUSTOMER |
P.ORDER | A.ORDER | T.ORDER |
There is a relationship definition for the pair of tables CUSTOMER and ORDER in the production subsystem, called PROD in the example, but none in the acceptance subsystem. You want to use this relationship information as the model to extract data from the CUSTOMER and ORDER tables residing in the acceptance subsystem (ACCEPT) to populate the CUSTOMER and ORDER tables in the test subsystem (TEST).
To perform this extract:
Specify A.CUSTOMER to drive the extract process.
Driving Object - Db2File-AID/RDX ------------- DB2 Driving Object -------------------------------
Command ===>
Primary commands: MVS object, REFerence, REQuest
Specify table to drive extract process:
SSID ===> ACPT
Location ===> LOCATION (* or pattern for selection list)
Creator ===> A (* or pattern for selection list)
Table Name ===> CUSTOMER (* or pattern for selection list)
Relationship Information:Select the P.CUSTOMER relationship definition, if more than one relationship definition exists for the Table Name value (CUSTOMER).
Relationship Listing
Specify the P.CUSTOMER to P.ORDER relationship definitions from the PROD subsystem as the extract criteria for the tables in the ACCEPT subsystem and exclude the other relationships.
Relationship Navigation CriteriaFile-AID/RDX ------- Relationship Navigation Criteria ---------- Row 1 from 5
Command ===> Scroll ===> PAGE
Primary Commands: EXclude/Unex, Change, Find, Hide, FILter, CHEck, SIze, SOrt
VIew, STATus, SAMple, NAVigation, VALidate, GRaphic, REPort
Line Commands: X = Exclude U = Unexclude I = Info
Driving Object: A.CUSTOMER
SSID: ACPT Location: LOCATION Navigation Criteria
Seq Object Name Dir Par Sib Ind Status
---- ---------------------------------------------- --- --- --- --- ----------
X001 A.CUSTOMER Y - - -
A.CONTACT CONTCUST
0002 A.CUSTOMER Y - - -
A.ORDER Customer to Order AR
X003 A.ORDER Y - - -
A.ORDER_LINE ORDLORD
X004 A.PART - Y N -
A.ORDER_LINE ORDLPRT
X005 A.PART - - - N
A.SUPPLIER SUPPPART
******************************* Bottom of data ********************************Specify T as Creator ID and TEST as subsystem ID for the tables into which to load the extracted data (the target tables).
Load Object Specification
File-AID/RDX --------------- Load Object Specification ------------------------ .
Command ===>
Specify Target DB2 Environment:
SSID ===> TEST
Location ===>
DB2 Load Method ===> SQL (SQL = SQL Insert Statement;
DB2 = DB2 Batch Load Utility)
Specify Object Name Modifiers: (/ entry to apply modification)
/ DB2 Creator ===> T (Creator for ALL DB2 objects)
_ DB2 Index name prefix ===>
_ DB2 Index name suffix ===>
_ MVS high level qualifier ===> TSOID01 (HLQ for ALL MVS objects)
_ MVS file name suffix ===> NEW
_ Revert to source names ===> (D = DB2 objects;
M = MVS objects; B= Both)File-AID/RDX uses the relationship information for CUSTOMER to ORDER from the PROD subsystem. It extracts data from the ACCEPT subsystem using the PROD relationship information. It populates the CUSTOMER and ORDER tables in the TEST subsystem with the extracted data. See the following figure for a diagram illustrating the use of relationships across subsystems.
Extracting Data From Subsystem ACCEPT Based on Relationships in Subsystem PROD