IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to do One to One matching on keys of 2 files in DFSORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ajaimohanc

New User


Joined: 24 Aug 2007
Posts: 5
Location: Pune

PostPosted: Mon Apr 28, 2008 11:52 am
Reply with quote

Hi,
I have 2 input files. I want to do a one to one match on key-fields of 2 files and pick records in FILEA which are not in FILEB. Here I need to pick the additional duplicate Records in FILEA also in case match present for a duplicate record.
Below is my requirement. first 4 bytes are key-fields.

FILEA recs-
KEYA123
KEYB234
KEYB345
KEYC544
KEYC654
KEYD367

FILEB recs-
KEYA123
KEYB234
KEYC544
KEYC654

Output file recs-

KEYB345
KEYD367

Please help me how to do this in DFSORT?
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Apr 28, 2008 10:39 pm
Reply with quote

ajaimohanc,

The following DFSORT/ICETOOL JCL will give you the desired results. I assumed that your input files are of 80 bytes LRECL and FB RECFM.

Code:

//STEP0100 EXEC PGM=ICETOOL                                     
//TOOLMSG  DD SYSOUT=*                                         
//DFSMSG   DD SYSOUT=*                                         
//IN1      DD *                                                 
KEYA123                                                         
KEYB234                                                         
KEYB345                                                         
KEYC544                                                         
KEYC654                                                         
KEYD367                                                         
//IN2      DD *                                                 
KEYA123                                                         
KEYB234                                                         
KEYC544                                                         
KEYC654                                                         
//T1       DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(1,1),RLSE)   
//OUT      DD SYSOUT=*                                         
//TOOLIN   DD *                                                 
  COPY FROM(IN2) USING(CTL1)                                   
  COPY FROM(IN1) USING(CTL2)                                   
  SPLICE FROM(T1) TO(OUT) ON(1,7,CH) WITHALL WITH(01,80) -     
  KEEPNODUPS USING(CTL3)
/*                                       
//CTL1CNTL DD *                         
  OUTFIL FNAMES=T1,OVERLAY=(81:1,7)     
//CTL2CNTL DD *                         
  OUTFIL FNAMES=T1,OVERLAY=(81:7X)       
//CTL3CNTL DD *                         
  OUTFIL FNAMES=OUT,BUILD=(01,80),       
  INCLUDE=(1,7,CH,NE,81,7,CH)           
/*


Hope this helps...

Cheers
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top