Hi, I need to sort first 'N' records of each KEY in a set of records having many records with duplicate keys. Example is shown below::
Input Records:
AAA 1234
AAA 2345
AAA 9878
AAA 6754
BBB 5675
BBB 2346
BBB 2345
CCC 5674
CCC 4325
AAA 3453
BBB 3636
From the above input, I need to sort out first 2 records of each Key (Key = First 3 bytes) and write in out file the combined output
Expected output.
AAA 1234
AAA 2345
BBB 5675
BBB 2346
CCC 5674
CCC 4325
Is there any utility that can be used for the above scenario ? Could any one help me with the solution for the above problem?
It is greatly appreciated, if you provide and solution which can be used in a JCL.
-Ram