I’m looking for a SORT Joinkey Jcl or ICETool JCL solution for the following scenario. Can anyone please help me.
I have 4 VB flat files:
File1 – RCfile – Parent File to FILE2,FILE3,FILE4
File2 – RDfile – Child of File1
File3 – RGfile – Child of File1
File4 – VRfile – Child of File1
I want to extract into separate out files on records from File2,File3 and File4 only if they have a matching Parent record on File1. I want to leave have all the files in the same format in/out. And I want to sort the new output files as follows:
You need to do a better job of explaining what it is you want to do. Please show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If any file (e.g. file1) can have duplicates within it, show that in your example.
I have looked at the examples and can't quite locate on that does what I need with multiple files in one step. I'm experimenting with some of the samples. If I get it, I'll be sure to post the sample for everyone to enjoy. Thanks..
The following DFSORT JCL will give you the desired results. It does the match and also sorts on the file 2, 3, 4 also.
Step0100 : Creates a VB delimiter file with delimiter $$$ in pos 5 (first 4 bytes of rdw).
Step0200 : We now use above created file and concatenate files 2,3,4 to perform the match. The $$$ ind will be used to distinguish file2, 3, 4. Using the WHEN=GROUP function, we pad an indicator at pos 5 and use that indicator to populate the key values from different places from the respective files. Since all the files are VB we manipulate the key right after RDW. Once we get the Matching records we then overlay the fields from different files to the sort main task based on the same ind.
Using OUTFIL we remove the indicator and temp fields and write out the actual file data from the respective files.