Unloading specific records in a foreign key, cascade format.
We have DB2 version 8, os/390. I know how to use QMF and JCL.
I would like to unload, to files, specific records that I would enter, by the key, in a where clause. The record would then cascade down to unload ALL tables, with a specified TBCREATOR name based on foreign keys. I would like the records to be unloaded to their own files.
For Example:
There are 5 (actually there could be 100 or more, but for this purpose, I'll just use 5 for brevity) tables: TBA.ONE, TBA.TWO, TBA.THREE, TBB.ONE, TBC.ONE, TBA.FOUR, TBA.FIVE
I would use the where clause on the TBA.ONE to specify a key. It would load that record to a data set. Then it would take the foreign key of TBA.ONE, use it to get the record from TBA.TWO and put it to a data set. It would use the foreign key of TBA.THREE and get the record and put it in a data set. etc...
Would there be an issue with creating duplicate data sets when more than one table has the same foreign key?
The problem is, we have a production region where a customer says they have an issue with a specific record. Usually, we don't have that exact record in the Test Region. In order to resolve the program problem, we need the exact same data in the test region. How does one transfer all applicable records, from all applicable tables, from the one region to the other?



