Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
rajesh_m,
With z/OS DFSORT V1R5 PTF UK51706 or z/OS DFSORT V1R10 PTF UK51707 (Nov, 2009), DFSORT now supports the JOINKEYS function which is used for matching the keys and get the desired results
Use the same file for both SORTJNF1 and SORTJNF2 and for JNF2 file select all the records without an 'A' or 'B' in col 6 and eliminate the dups. Once you join these records to file1 records we can eliminate all the matching records and write out just unpaired records from F1
have you tried anything ? Have you searched for INCLUDE DFSORT ?
Gerry,
I would be really interested to know how it can be done with an INCLUDE condition. The condition here is check if each key has just an 'A' and 'B' record alone and it cannot have any other codes
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Gerry,
You really don't need 3 passes to get the desired results. Here is a two pass DFSORT/ICETOOL job
Code:
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
KEY1 A
KEY1 B
KEY1 C
KEY1 D
KEY2 A - RECORD 1
KEY2 B - RECORD 2
KEY2 C - RECORD 3
KEY3 D
KEY3 E
KEY3 F
KEY4 A
KEY4 B
KEY5 A
KEY5 B
KEY5 D
//T1 DD DSN=&&T1,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(T1) ON(1,4,CH) EQUAL(3) USING(CTL1)
SELECT FROM(T1) TO(OUT) ON(1,4,CH) EQUAL(3)
//*
//CTL1CNTL DD *
OUTFIL FNAMES=T1,INCLUDE=(6,1,SS,EQ,C'A,B,C')
//*