identify duplicates in a file and tag them with 'D'



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

identify duplicates in a file and tag them with 'D'

Postby rakeshsneha1212 » Wed Jan 10, 2018 11:35 am

Hi All,

Can some one help me identifying duplicates in a file which has a key field and tag them with character 'D' i.e adding a new column which identifies it as a duplicate record in the same file. Regards,
Rakesh MS
rakeshsneha1212
 
Posts: 27
Joined: Thu Mar 30, 2017 2:09 pm
Has thanked: 5 times
Been thanked: 0 time

Re: identify duplicates in a file and tag them with 'D'

 

Re: identify duplicates in a file and tag them with 'D'

Postby rakeshsneha1212 » Wed Jan 10, 2018 12:22 pm

rakeshsneha1212 wrote:Hi All,

Can some one help me identifying duplicates in a file which has a key field and tag them with character 'D' i.e adding a new column which identifies it as a duplicate record in the same file. Regards,
Rakesh MS



Keys fields constitutes of three fields 1,9,CH,10,10,CH,22,12,CH. we need to identify the duplicate and then overlay with 'D' if it is identified as a duplicate record.

Please note it's a single flat file which contains records
rakeshsneha1212
 
Posts: 27
Joined: Thu Mar 30, 2017 2:09 pm
Has thanked: 5 times
Been thanked: 0 time

Re: identify duplicates in a file and tag them with 'D'

Postby NicC » Wed Jan 10, 2018 3:41 pm

Are you talking about duplicate keys only or the whole record being a duplicate? And it is a data set not a 'file'.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2812
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 116 times

Re: identify duplicates in a file and tag them with 'D'

Postby rakeshsneha1212 » Wed Jan 10, 2018 3:46 pm

NicC wrote:Are you talking about duplicate keys only or the whole record being a duplicate? And it is a data set not a 'file'.


only the key being duplicate. yeah,data set corrected.

regards,
Rakesh MS
rakeshsneha1212
 
Posts: 27
Joined: Thu Mar 30, 2017 2:09 pm
Has thanked: 5 times
Been thanked: 0 time

Re: identify duplicates in a file and tag them with 'D'

Postby NicC » Wed Jan 10, 2018 7:29 pm

Group the records on the key, assigning a sequence number to each record within the group. Reset the squence number on change of group. When writing out drop the sequence number if it is '1' otherwise replace by 'D'. Samples of this sort of thing abound within the forum.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2812
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 116 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post