Using the "Smart DFSORT Tricks" manual, section "No match, VB, key in different 
places, duplicates", I understand how to get the NOT matched records from file 
2.

I need to get the MATCHED records from file 2 plus the always-un-matched header 
and trailer records from file 2 in one output file.

The basic task is matching a file of keys-to-be-included (F1) with a data file 
(F2) containing those keys in a different position with many possible 
duplicates.  All duplicates in F2 are to be kept.  The data file (F2) also 
contains a header (assume a key of all zeroes) and a trailer (assume a key of 
all 9's) that never match.  Key length is 7 bytes.

This (modified) example from the PDF will get me the UN-matched F2 records:

//JK8 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD DSN=... input file1 (FB/40)
//IN2 DD DSN=... input file2 (VB/1000)
//SORTOUT DD DSN=... output file (VB/1000)
//SYSIN DD *
JOINKEYS F1=IN1,FIELDS=(1,7,A)
JOINKEYS F2=IN2,FIELDS=(33,7,A)
JOIN UNPAIRED,F2,ONLY
OPTION COPY
/*

How do I get MATCHED records from F2 only plus unmatched header and trailer 
from F2 in one output file?

TIA for any assistance you can offer.

Peter
--


This message and any attachments are intended only for the use of the addressee 
and may contain information that is privileged and confidential. If the reader 
of the message is not the intended recipient or an authorized representative of 
the intended recipient, you are hereby notified that any dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please notify us immediately by e-mail and delete the message and any 
attachments from your system.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to