The JOIN control statement specifies the disposition of paired and unpaired records in a join.
When you do not provide a JOIN control statement in an application that has JOINKEYS control statements, MFX produces an output from the join operation that includes all paired records (an “inner join”). All unpaired records from both SORTJNF1 and SORTJNF2 are discarded. By providing a JOIN control statement, you can specify that unpaired records are to be included in the join output (an “outer join”). Parameters of the JOIN statement provide options as to which of the unpaired records are to be retained for output.
See the descriptions of the JOINKEYS and REFORMAT control statements for additional information.
JOIN Control Statement Format
Retaining Unpaired Records
When joining files, a record from one file may or may not have a match in the other file. A match occurs when the contents of the join keys in the record from the first file equal the contents of the join keys in the record from the second file.
By specifying the JOIN statement you can discard unpaired records from one or both files, or retain unpaired records from both files.
or simply:
Discarding Paired Records
If you want to keep only the unpaired records from one SORTJNF1 or SORTJNF2, add either the F1 or the F2 parameter.
For more information, see Joining Records from Multiple Files.