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

Syncsort Merge and remove duplicates in one step!


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

New User


Joined: 21 Jul 2006
Posts: 39
Location: US

PostPosted: Fri Nov 06, 2009 12:51 am
Reply with quote

Hi all!

I want to merge two files on one field. And then I want to remove the duplicates from this merged file based on some other field.
e.g.

File A + File B = File C - Merge on field 1
File C - Remove duplicates based on field 2.

Is this possible in a single SORT step? Is there any other(other than 2 steps) efficient way of doing this?

Thanks!
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Nov 06, 2009 12:53 am
Reply with quote

syncsort or dfsort?
Back to top
View user's profile Send private message
shilpa.khaire

New User


Joined: 21 Jul 2006
Posts: 39
Location: US

PostPosted: Fri Nov 06, 2009 1:14 am
Reply with quote

Syncsort, even Synctool can do.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Thu Nov 12, 2009 2:49 am
Reply with quote

shilpa.khaire wrote:
Hi all!

I want to merge two files on one field. And then I want to remove the duplicates from this merged file based on some other field.
e.g.

File A + File B = File C - Merge on field 1
File C - Remove duplicates based on field 2.

Is this possible in a single SORT step? Is there any other(other than 2 steps) efficient way of doing this?

Thanks!

Yes, this can be accomplished in a single SyncSort step. If you provide sample input records and your desired output (including the RECFM and LRECL of each file), we can better assist you with the control statements.
Back to top
View user's profile Send private message
shilpa.khaire

New User


Joined: 21 Jul 2006
Posts: 39
Location: US

PostPosted: Fri Nov 13, 2009 1:15 am
Reply with quote

First Merge is on and the LRECL is 1500.
SORT FIELDS=(463,10,CH,D)

This is the second step which takes the output of above as an input.
SORT FIELDS=(26,21,CH,A),EQUALS
SUM FIELDS=NONE,XSUM

Op RECFM is FB and LRECL = 1500, same as input

Thanks!
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Fri Nov 13, 2009 2:13 am
Reply with quote

I am not clear as to what your first step is doing. Are you trying to "merge" or "join" a record from File 1 with a record from File 2 to create a new record, or are you combining all records from File 1 and File 2 to create a master file?
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

 


Similar Topics
Topic Forum Replies
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
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top