Joined: 09 Mar 2011 Posts: 7312 Location: Inside the Matrix
JOINKEYS with the same file on both input DDs.
In JNF1CNTL using INREC with WHEN=GROUP for the DOC to PUSH an ID to an extension of the record.
In JNF2CNTL use INCLUDE to get only the DOC records. Use INREC to put a sequence number in an extension to the record (same length as the ID you PUSHed in the other). Then subtract two from the sequence number.
A REFORMAT statement with the entire F1 record and the match marker.
In the main task, INCLUDE for (match marker equal to B AND extension equal to 1 or 2), OR match marker equal to 1 (unmatched records).