Use JOINKEYS with the same dataset for both inputs.
Use JNF1CNTL to extend the records to include a key and an ID for WHEN=GROUP with PUSH (so all records in the group get the same key and same ID, a sequence number for groups).
Use JNF2CNTL to specify just the GROUP output (key and ID) and with OPTION EQUALS and SUM FIELDS=NONE ensure the first record only is output. Use BUILD= with IFTHEN=(WHEN=INIT to ensure the cut-down record is pre-processed for the SORT.
Om the F1 JOINKEYS specify SORTED,NOSEQCK
No need of a JOIN, as you get only matches by default.
On the REFORMAT statement just specify your original F1 record without the extension.
Other than where you extend for fixed-/variable-length records, that's about ti.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum