On Tue, 30 Apr 2019 13:07:05 -0500, Ron Thomas wrote: > >We have a below CSV file and here we need to generate a number in the 1st >column based on whether there is duplicates on the 2nd column. > >102016,3522850,15,FF,9 >104152,3522850,15,FF,7 >104152,3522850,15,FF,9 >104760,3521499,15,FF,9 >104760,3521499,15,FF,9 >106735,3507181,15,FF,9 > >so the o/p need to be as follows > >1,102016,3522850,15,FF,9 >1,104152,3522850,15,FF,7 >2,104152,3522850,15,FF,9 >1,104760,3521499,15,FF,9 >2,104760,3521499,15,FF,9 >1,106735,3507181,15,FF,9 > Can you rely on the data being sorted initially?
Must you likewise handle triplicates, quads, etc.? >Could someone let me know how this can be achieved in a DFSORT > I'd do it with Rexx (or even awk), but there's probably a DFSORT approach (which would perform better). -- gil ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
