Remove dulicates from the file using sort step.



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Remove dulicates from the file using sort step.

Postby shafeequehere » Sat Oct 10, 2009 3:23 pm

Hi,

I have two files File1 and File2.

column 1 and column 2 are keys.

I need to merge these two files, In case of duplicates, the record in the File1 wins.

How can I do that using Sort step in JCL?

Ex : File1 has following data

column 1 column 2 column 3 column 4 column 5
12 shaf 10 20 30

Ex : File2 has following data

column 1 column 2 column 3 column 4 column 5
12 shaf 11 21 31

In this case it is unique by column1 and column2 . So record in the file1 should win.
shafeequehere
 
Posts: 9
Joined: Sat Oct 10, 2009 2:58 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Remove dulicates from the file using sort step.

 

Re: Remove dulicates from the file using sort step.

Postby dick scherrer » Sun Oct 11, 2009 3:33 am

Hello and welcome to the forum,

Which sort product (and which release) is used on this system?

Depending on which sort product is used and how current the release, the way to do this may vary.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Remove dulicates from the file using sort step.

Postby shafeequehere » Sun Oct 11, 2009 2:58 pm

Please tell me the way how normal sorting is done to solve the above mentioned problem.

I am not sure of the sort prouct and release.
shafeequehere
 
Posts: 9
Joined: Sat Oct 10, 2009 2:58 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Remove dulicates from the file using sort step.

Postby dick scherrer » Mon Oct 12, 2009 11:34 pm

Hello,

I am not sure of the sort prouct and release.
Then run some sort and look at the informational output. . .

Please tell me the way how normal sorting is done to solve the above mentioned problem.
Depending on which sort product is used and how current the release, the way to do this may vary.
Was there something not clear here? Depending on the product, the code may vary. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Remove dulicates from the file using sort step.

Postby shafeequehere » Wed Oct 14, 2009 7:54 pm

I think it is 1.2.3.1R
shafeequehere
 
Posts: 9
Joined: Sat Oct 10, 2009 2:58 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Remove dulicates from the file using sort step.

Postby dick scherrer » Wed Oct 14, 2009 11:49 pm

Hello,

I suspect that is Syncsort. . . Which would be in the same output where the 1.2.3.1R was found. . .

Suggest you review JOINKEYS in the documentation.

If this IS a Syncsort question, i'll move your topic to the Syncsort part of the forum.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Remove dulicates from the file using sort step.

Postby shafeequehere » Sun Oct 18, 2009 3:20 pm

Yes....This a Syncsort
shafeequehere
 
Posts: 9
Joined: Sat Oct 10, 2009 2:58 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Remove dulicates from the file using sort step.

Postby shafeequehere » Mon Oct 19, 2009 9:23 pm

Please move this topic to the Syncsort part of the forum and get this done.
shafeequehere
 
Posts: 9
Joined: Sat Oct 10, 2009 2:58 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Remove dulicates from the file using sort step.

Postby Alissa Margulies » Mon Oct 19, 2009 10:22 pm

shafeequehere,

As long as there are no duplicate keyed records within FILE1 or FILE2 themselves, you should be able to use the following sort step:

//SORT1 EXEC PGM=SORT,PARM='EQUALS'   
//SYSOUT DD SYSOUT=*                   
//SORTIN DD DSN=FILE1,DISP=SHR         
//       DD DSN=FILE2,DISP=SHR         
//SORTOUT DD SYSOUT=*                 
//SYSIN     DD   *                     
   SORT FIELDS=(1,2,CH,A,4,4,CH,A)     
   SUM FIELDS=NONE                     
/*                                     

If there are duplicates within File1 or File2, let me know and I'll modify the code for you.
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 1 time

Re: Remove dulicates from the file using sort step.

Postby dick scherrer » Mon Oct 19, 2009 11:54 pm

Hello,

Please move this topic to the Syncsort part of the forum and get this done.
Continue with this attitude and your posts will be deleted. Just who do you think you are to post "get this done". . . :roll:

It would also probably be good if you paid the slightest bit of attention - the topic was relocated long before this nonsense post was entered. . . :evil:

d
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Next

Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post