Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Matching with Key at different postions. rajatbagga DFSORT/ICETOOL 12 Wed Nov 09, 2016 10:58 am
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us