Example: File 1 is a master file with an LRECL of 3400 and contains 140 million fixed-length records. There is a unique 15-byte printable account number that appears in column 22 and you want to copy a large number of these records to a separate output file for further processing. All records in this file are in account number sequence.
File 2 has an LRECL of 15 and contains 285,000 fixed-length records. The only field in these records is a 15-byte printable account number. This file is also in account number sequence.
Using join processing, you can execute an application where File 1 is the master file and File 2 is your “finder” file. Join processing will create a new output file that will “copy” only those records with account numbers that exist in File 2.
Following are some sample segments from the input file:
Note that the “SORTED” parameter has been added to each JOINKEYS control statement, because the files are already in the desired sequence. If either file were not in account number sequence, the application would terminate with an error message. To address this problem, you would have to remove the applicable “SORTED” parameter from the corresponding JOINKEYS control statement.
This directs join processing to include only the records from File 1, the master file, that do not have a record in File 2 with the same account number.