This is using ICETOOL or SYNCTOOL
Select on 2nd file only last duplicate record by key.
Join file 1 and file 2 to extract matches and keep what you want.
This is a sample working on both product(for dfsort you need V1R10)
//P010 EXEC PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//I2       DD *
100000038  4366456
100000039  494165545
100000040  497228431
100000041  408506918
100000041  408506912
//CTL1JNF2 DD SPACE=(CYL,1)
//CTL1JNF1 DD *
100000038  004366456
100000039  494165545
100000040  497228431
100000041  408506918
//OUT      DD SYSOUT=*
//TOOLIN   DD *
  SELECT FROM(I2)       TO(CTL1JNF2) ON(001,009,CH) LASTDUP
  COPY   FROM(CTL1JNF1) TO(OUT) USING(CTL1)
//CTL1CNTL DD *
 JOINKEYS   FILE=F1,FIELDS=(001,009,A)
 JOINKEYS   FILE=F2,FIELDS=(001,009,A)
 JOIN UNPAIRED,F2
 REFORMAT FIELDS=(F2:001,020)
 OUTFIL   FNAMES=OUT

Result is: 100000041  408506912

Hope in this.
Regards.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to