Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to do One to One matching on keys of 2 files in DFSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: How to do One to One matching on keys of 2 files in DFSORT
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts JES2 job size field matching Windows ... SRICOBSAS All Other Mainframe Topics 4 Tue Sep 05, 2017 5:49 pm
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us