Using Join Processing To Copy a Large Number of Master File Records - mfx - 3.1

Syncsort™ MFX Programmers Guide

Product type
Software
Portfolio
Integrate
Product family
Syncsort™ Software
Product
Syncsort™ MFX > MFX
Version
3.1
Language
English
Content type
Programmer’s Guide
Product name
Syncsort™ MFX
Title
Syncsort™ MFX Programmers Guide
Copyright
2024
First publish date
2010
Last updated
2024-11-06
Published on
2024-11-06T17:38:26.716054

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.

Use the following JCL and control statements:
Figure 1. JCL and Control Statements

Following are some sample segments from the input file:

Figure 2. Master File Excerpts

Following are records from the finder file:
Figure 3. Finder File

Following are segments of the output file:
Figure 4. Output File Excerpts

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.

Example: This is a variation of the previous example. If you wanted to copy all of the records in the master file except those with matching account numbers in the second file, just add the following control statement to the JCL for that example:
Figure 5. JOIN 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.