Page 1 of 1

Reading from 2 input files using SORT

Posted: Fri Apr 11, 2014 10:24 pm
by goldyroshan
I have 1st input file having control numbers from 1st to 9th position.
Another input file having lots of fields including control numbers from 3000th position (9 bytes).

I want to read 1st file for Control Numbers, find them in 2nd input file & extract the same records (same control numbers) from 2nd input file into output file.

Please suggest SORT JCL for the same.

Posted: Fri Apr 11, 2014 11:19 pm
by William Collins
How many records on the control file?

Posted: Sun Apr 13, 2014 10:28 pm
by DikDude
One way would be to use JOINKEYS.

There are examples in the forum or the documentation.

Posted: Mon Apr 14, 2014 6:03 am
by goldyroshan
614 records in control file

Posted: Mon Apr 14, 2014 8:44 am
by William Collins
Yes, as DikDude suggested, JOINKEYS for a multiple-record control file.

Posted: Wed Apr 16, 2014 10:28 am
by goldyroshan
Thanks William & DikDude. I was able to get the desired result using JOINKEYS.

Posted: Thu Apr 17, 2014 9:38 pm
by DikDude
Thank you for letting us know :)

dd