The input file is of 10 bytes (FB) as given below and the key is first 6 bytes (numeric). There are duplicate values in the file as shown below. The requirement is to write at most last 3 duplicates of each key value while keeping the order of records same. The output file is also of 10 bytes FB.
Thanks Frank. I used the same logic but in 3 different steps.
However, I had faced problems while using temporary file as the input file was very large (about 7 million records). We increased the number of cylinders of the temp dataset but the job was still failing due to space abend.
When we hard coded the intermediate file (replaced the temporary file with an emplty file created in other step) and then passed it to the subsequent steps , the problem was resolved.