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

Compare two files and remove duplicates


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Shivendu

New User


Joined: 20 Feb 2009
Posts: 14
Location: Workstation

PostPosted: Mon Apr 06, 2009 6:35 pm
Reply with quote

Thanks all....it is done icon_smile.gif
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Mon Apr 06, 2009 9:21 pm
Reply with quote

Shivendu wrote:
Need to compare data in two files FILE1 and FILE2. Data which is present ONLY in FILE2 should be written to a new file FILE3 (i.e removing duplicates)

Coding a simple SyncSort JOIN application will also produce the desired results. For example:
Code:
//STEP1  EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTJNF1 DD DSN=FILE1,... 
//SORTJNF2 DD DSN=FILE2,...   
//SORTOUT  DD DSN=FILE3,... 
//SYSIN    DD *
  JOINKEYS FILES=F1,FIELDS=(1,3,A) 
  JOINKEYS FILES=F2,FIELDS=(1,3,A) 
  JOIN UNPAIRED,F2,ONLY 
  SORT FIELDS=(1,13,CH,A)
  DUPKEYS FIELDS=NONE 
/*
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Tue Apr 07, 2009 11:04 am
Reply with quote

Quote:
It's a bit urgent.

Urgent for you maybe.
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 -> JCL & VSAM Goto page Previous  1, 2

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top