What does join unpaired mean?

JOIN UNPAIRED,F1,ONLY is used to restrict the output (SORTOUT) to the records in F1 that do not have matching keys in F2. UNPAIRED,F1,F2 to keep the unpaired joined records as well as the paired join records.

How do I get matched records in JCL?

JCL SORT to join two files and writes records from both files :

  1. Matched Records (Inner Join) –
  2. Matched Records and Non Matched Records from File1 –
  3. Non Matched from File1 –
  4. Matched Records and Non Matched from File2 –
  5. Non Matched from File2 –
  6. Matched Records and Non Matched Records from both files –

How does join keys work in JCL?

With the help of JOINKEYS in SORT JCL, various join operation on matched and non-matched records can be executed based on matching fields or Keys. Joining can be performed in number of ways like inner join, full outer join, left outer join, right outer join and unpaired combinations.

How to sort two files with joinkeys in JCL?

JOINKEYS specifies the field on which the two files are compared. REFORMAT FIELDS=? places ‘B’ (matched records), ‘1’ (present in file1, but not in file2), or ‘2’ (present in file2 but not in file1) in the 1st position of the output BUILD. JOIN UNPAIRED does a full outer join on the two files.

How is a JOIN statement executed in JCL?

To perform operations on records in different flat files, JOINKEYS are used. With the help of JOINKEYS in SORT JCL, various join operation on matched and non-matched records can be executed based on matching fields or Keys.

What kind of JOIN statement does joinkeys use?

If you don’t specify a JOIN statement for a JOINKEYS application, only paired records from F1 and F2 are kept and processed. This is known as an inner join. The joined records will be the original unpaired F1 records.

How to use JCL to join two datasets?

Here is a sample JCL to join two datasets using JOINKEY, and you can write output to a new dataset. Two JOINKEYS statements are required: one for the F1 data set and another for the F2 data set.