TSO-ISPF JCL COBOL VSAM DB2 CICS IMS-DB Tools Articles Forum Quiz Interview Q&A

JCL - JCL SORT Join Statement


JCL Join Statment:

JCL sort JOIN statement is used to retrieve what record from input file 1 and input file 2. In case, If you don't specify a JOIN statement, only matched(i.e. paired) records from input file 1(F1) and input file 2(F2) are kept and processed by the main task as the joined records. This join we call it as an inner join.

JOIN UNPAIRED {F1/F2/ONLY}

You can change which records are kept and processed by the main task as the joined records by specifying a JOIN statement. You must specify the UNPAIRED operand. The F1, F2 and ONLY operands are optional.

The JOIN operands you specify indicate the joined records to be kept and processed by the main task as follows:

  1. UNPAIRED,F1,F2 or UNPAIRED

    Unpaired records from F1 and F2 as well as paired records. This is known as a full outer join.

  2. UNPAIRED,F1

    Unpaired records from F1 as well as paired records. This is known as a left outer join.

  3. UNPAIRED,F2

    Unpaired records from F2 as well as paired records. This is known as a right outer join.

  4. UNPAIRED,F1,F2,ONLY or UNPAIRED,ONLY

    Unpaired records from F1 and F2.

  5. UNPAIRED,F1,ONLY

    Unpaired records from F1.

  6. UNPAIRED,F2,ONLY

    Unpaired records from F2.


If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!

Are you looking for Job Change? Job Portal