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: 1248
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 3 files concatenated to 1 DFSORT/ICETOOL 2
No new posts JCL sort to compare dates in two file... DFSORT/ICETOOL 2
No new posts Compare 2 alphabets in a REXX and fin... CLIST & REXX 2
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files and write Matched/Unm... JCL & VSAM 8
Search our Forums:

Back to Top