Page 1 of 1

Edit XSUM file

PostPosted: Thu Dec 15, 2016 3:20 pm
by Raja190
Hi,

i need to remove duplicates from a file and write duplicate records in to another file. i know this can be done through (sum fields=none,xsum) , but i want to make a small change in the duplicate record (edit duplicate) and write it to SORtXSUM file

input file:
A123456789
A123456789
A987654321

output file:
A123456789
A987654321


The duplicate from input file will be written to SORTXSUM file and just need to change the first byte from 'A' to 'B'.
SORTXSUM File:
B123456789

Re: Edit XSUM file

PostPosted: Thu Dec 15, 2016 3:42 pm
by BillyBoyo
You sample data is in key order. Why SORT it?

What does your documentation about about using OUTFIL with SORTXSUM?

If you can't do that, then no, you can't get at records which are only on that file other than by reading it once it is finished with (another step (or ICETOOL operator).

In place of XSUM, you could extend the records with a sequence number with RESTART= for the key, and have two OUTFILs, one to process all records with sequence equal to one, the other to process everything else, using SAVE. In the second OUTFIL make your change as you BUILD to drop off the sequence number. In the first OUTFIL, just BUILD to drop off the sequence number.