JOIN statement

Read syntax diagramSkip visual syntax diagram
                   .-,--------.   
                   V          |   
>>-JOIN--UNPAIRED----+------+-+--------------------------------><
                     +-F1---+     
                     +-F2---+     
                     '-ONLY-'     

If you don't specify a JOIN statement for a JOINKEYS application, only paired records from F1 and F2 are kept and processed by the main task as the joined records. This is known as an inner join.

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:
UNPAIRED,F1,F2 or UNPAIRED
Unpaired records from F1 and F2 as well as paired records. This is known as a full outer join.
UNPAIRED,F1
Unpaired records from F1 as well as paired records. This is known as a left outer join.
UNPAIRED,F2
Unpaired records from F2 as well as paired records. This is known as a right outer join.
UNPAIRED,F1,F2,ONLY or UNPAIRED,ONLY
Unpaired records from F1 and F2.
UNPAIRED,F1,ONLY
Unpaired records from F1.
UNPAIRED,F2,ONLY
Unpaired records from F2.