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

Remove Duplicates


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

New User


Joined: 22 Feb 2010
Posts: 56
Location: Cochin

PostPosted: Wed May 11, 2011 12:39 pm
Reply with quote

I have a requirement

There are 2 files with same layout each having the following fields in it.
1) Member ID (1-8) and (1 is the start pos, 8 end pos)
2) Member name (10-20)

I want to remove the records from the 1st file if the member ID in the 1st file is present in the 2nd file? i.e I want to extract only those records from 1st file to output file if it is not present in 2nd file...

Is this possible to achieve this using dfsort? please help
Back to top
View user's profile Send private message
Dsingh29

Active User


Joined: 16 Dec 2008
Posts: 132
Location: IBM

PostPosted: Wed May 11, 2011 12:59 pm
Reply with quote

Hi.

Look at the previous topic:

ibmmainframes.com/about28564.html
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed May 11, 2011 4:18 pm
Reply with quote

Dsingh29 wrote:
Hi.

Look at the previous topic:

ibmmainframes.com/about28564.html


Hi Dsingh... This is very old topic.. and solution based on DFSORT at that time..

Now it is much smarter than that time... icon_smile.gif

Code:
//STEP0100 EXEC PGM=SORT           
//SYSOUT   DD SYSOUT=*             
//FILE1    DD *                     
MEMID001  AAAAAAAAAAAAAA           
MEMID002  BBBBBBBBBBBBBB           
MEMID003  CCCCCCCCCCCCCC           
//FILE2    DD *                     
MEMID003  CCCCCCCCCCCCCC           
MEMID004  DDDDDDDDDDDDDD           
MEMID005  EEEEEEEEEEEEEE           
//SORTOUT  DD SYSOUT=*             
//SYSIN    DD *                     
  OPTION COPY                       
  JOINKEYS F1=FILE1,FIELDS=(1,8,A) 
  JOINKEYS F2=FILE2,FIELDS=(1,8,A) 
  JOIN UNPAIRED,F1,ONLY   


Output will be..
Code:

MEMID001  AAAAAAAAAAAAAA     
MEMID002  BBBBBBBBBBBBBB     


seahawk789Let us know if this satisfies your requirement...
Back to top
View user's profile Send private message
seahawk789

New User


Joined: 22 Feb 2010
Posts: 56
Location: Cochin

PostPosted: Wed May 11, 2011 4:41 pm
Reply with quote

Thanks a lot guys..
Special thanks to 'Escapa' for a neat solution..
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 Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Remove leading zeroes SYNCSORT 4
No new posts How to remove block of duplicates DFSORT/ICETOOL 8
This topic is locked: you cannot edit posts or make replies. Compare files with duplicates in one ... DFSORT/ICETOOL 11
No new posts To Remove spaces (which is in hex for... JCL & VSAM 10
Search our Forums:

Back to Top