Remove duplicates in group record using key combination



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

Remove duplicates in group record using key combination

Postby erick999 » Tue Oct 08, 2013 10:16 pm

Hi my input file looks as below


Y adghfdhfe 56 shdghjhfhjs
C dhchhhhht d7 dgghjhfhhf
Y ghfhhvvhb f2 cvbbbbnjhg
C dvvbhhfffd 5n fghhjjjjjjhf
Y fdjfufftghrg 56 ghgffgghhf
C fhgvfhhcdff D7 ghcghhjjj
Y cvvccvvvvv 45 chcxghggh
C gggcvvvvhb. Fg ghhjjjhhjjg


I want to group record with Y & C and my key is the combination of two character in middle from both Y & C. My output should give only the unique combination of the keys along with the record.

It should look like


Y adghfdhfe 56 shdghjhfhjs
C dhchhhhht d7 dgghjhfhhf
Y ghfhhvvhb f2 cvbbbbnjhg
C dvvbhhfffd 5n fghhjjjjjjhf
Y cvvccvvvvv 45 chcxghggh
C gggcvvvvhb. Fg ghhjjjhhjjg

It's like unique key combination of all the records.the vale in first character is constant and the position of key is same in both Y and C

Can we do this in sync sort


Regards,
Erick
erick999
 
Posts: 4
Joined: Tue Oct 08, 2013 9:54 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Remove duplicates in group record using key combination

Postby erick999 » Tue Oct 08, 2013 10:21 pm

For this I am having the idea of

1) grouping this record
2) Append the keys like 56d7 in all the record
3) sort to remove the duplicate

I don't know the commands for sure

Can any one help me out
erick999
 
Posts: 4
Joined: Tue Oct 08, 2013 9:54 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Remove duplicates in group record using key combination

Postby Akatsukami » Tue Oct 08, 2013 10:41 pm

Do you indeed wish "d7" and "D7" is be judged identical, or is that a typo?
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Remove duplicates in group record using key combination

Postby erick999 » Tue Oct 08, 2013 10:54 pm

Identical
erick999
 
Posts: 4
Joined: Tue Oct 08, 2013 9:54 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Remove duplicates in group record using key combination

Postby BillyBoyo » Tue Oct 08, 2013 11:11 pm

To confirm that, d7 and D7 should be treated as the same? Which do you want on the output when this case arises? d7 or D7 by value, or that which is physically first/last on the file?

I think you are almost there with your suggested outline. What is the REFCM and LRECL?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Remove duplicates in group record using key combination

Postby erick999 » Wed Oct 09, 2013 12:25 am

d7 or D7 both are same. Let me put my requirement again

Group the first two record, a record has 2 from input file in order. First record starts as Y and the
The second one starts with C.

Key is in middle of two records. Consider If the first has AA and the second has BB. Then the key for the group is AABB.similarly we need to group all the records and the final out put is the unique combination of keys and its associated records for the first occurance.

In my example we have 56d7 and 56D7 both key are identical . I need any one of its associated record, if it is 56d7 output is 1st group I.e 1st and 2nd record. If it is 56D7 the output should have only 5th and 6 th record . I need any one of 56d7 combination. Hope this clarifies. Consider rec length as 80
erick999
 
Posts: 4
Joined: Tue Oct 08, 2013 9:54 pm
Has thanked: 0 time
Been thanked: 0 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post