Page 1 of 1

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

PostPosted: Wed Jan 10, 2018 11:35 am
by rakeshsneha1212
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

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

PostPosted: Wed Jan 10, 2018 12:22 pm
by rakeshsneha1212
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

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

PostPosted: Wed Jan 10, 2018 3:41 pm
by NicC
Are you talking about duplicate keys only or the whole record being a duplicate? And it is a data set not a 'file'.

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

PostPosted: Wed Jan 10, 2018 3:46 pm
by rakeshsneha1212
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

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

PostPosted: Wed Jan 10, 2018 7:29 pm
by NicC
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.