MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Remove Duplicates in one file using another file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
ranjit2705
Beginner


Joined: 25 Mar 2003
Posts: 12
Topics: 8

PostPosted: Thu Nov 12, 2009 11:24 pm    Post subject: Remove Duplicates in one file using another file Reply with quote

HI
I want to remove the records from FILEA which are present in FileB. Can this be done through SORT? Please help

Example
FILEA
AAAAA
BBBBB
CCCCC
DDDDD
EEEEEE
FFFFFFF

FileB
AAAAA
BBBBB

I want to create File C having
CCCCC
DDDDD
EEEEEE
FFFFFFF
_________________
Regards
Ranjit S Panda
Software Engineer
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Nov 13, 2009 11:09 am    Post subject: Reply with quote

ranjit2705,

Since you did not provide any more details like the LRECL, RECFM, Key Position and Format , I am assuming the following

Both Files are FB recfm and 80 byte lrecl and the key position is first 10 bytes and you don't have any duplicates within each file on the key

Concatenate both files together and use the following DFSORT ICETOOL JCL
Code:

//STEP0100 EXEC PGM=ICETOOL                   
//TOOLMSG  DD SYSOUT=*                       
//DFSMSG   DD SYSOUT=*                       
//IN       DD *                               
AAAAA                                         
BBBBB                                         
CCCCC                                         
DDDDD                                         
EEEEEE                                       
FFFFFFF                                       
//         DD *                               
AAAAA                                         
BBBBB                                         
//OUT      DD SYSOUT=*                       
//TOOLIN   DD *                               
  SELECT FROM(IN) TO(OUT) ON(1,10,CH) NODUPS 
/*

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Sat Nov 14, 2009 5:47 am    Post subject: Reply with quote

And nor do you specify which sort product that you are using. Also it is important to show which level of the product is installed as this may also affect the solution.

Please be aware that the solution may vary depending on which sort product that you are using, so you may have another forum member spending time on a solution which will not work because it is either the wrong product or the wrong release level.
_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group