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 getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts PA02 - Programmtically control attent... dodithegreat IMS DB/DC 1 Thu Apr 06, 2017 8:33 pm


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