Unique records from 2 columns



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

Unique records from 2 columns

Postby Ajaysingh007 » Thu Oct 07, 2010 10:28 am

Requirement: To get the unique rows from 2 columns of a file

1. No records from col-1 if the value is occuring more than once in col-1.
2. No records from col-2 if the value is occuring more than once in col-2.

Example of input is given below:

Col-1 Col-2
-------------
A1 B1
A1 B2
A2 B3
A3 B3
A4 B4
A5 B5
A6 B1
A1 B6
A7 B7
A8 B8

Sample expected Output:

Col-1 Col-2
-------------
A4 B4
A5 B5
A7 B7
A8 B8
Ajaysingh007
 
Posts: 1
Joined: Thu Oct 07, 2010 9:42 am
Has thanked: 0 time
Been thanked: 0 time

Re: Unique records from 2 columns

 

Re: Unique records from 2 columns

Postby dick scherrer » Fri Oct 08, 2010 12:03 am

Hello and welcome to the forum,

One way is to copy the file eliminating duplicates on col1 and then use that output to eliminate the duplicates on col2. This will be the set of records you want.
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


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post