I need to sort a FB file with LRECL 400. Sorting is to be done first on a 9 byte numeric field at position 10 and then on a 6 byte alpanumeric field at position 304. The file has 3 types of records based on a field at position 39. The field at position 39 can have values 10, 20 or 30. The grouping of the records needs to be maintained after the sort. The 304th byte has value only for type 10 records, for other records it is spaces. For a single type 10 record there can be any number (or none) of type 20 and type 30 records.
Some sample data is given below.
----+----1----+----2----+----3----+----4----....300----+----
111111111000000222AAAAAAA0000000000 10 ZAB123
111111111000000222AAAAAAA0000000000 20
111111111000000222AAAAAAA0000000000 20
111111111000000222AAAAAAA0000000000 30
111111111000000222AAAAAAA0000000000 30
222222222000000111BBBBBBBB000000000 10 ABC999
222222222000000111BBBBBBBB000000000 20
222222222000000111BBBBBBBB000000000 30
222222222000000111CCCCCCCC000000000 10 ABC888
222222222000000111CCCCCCCC000000000 20
222222222000000111CCCCCCCC000000000 30
333333333000000333DDDDDDDD000000000 10 ABCKKK
333333333000000333DDDDDDDD000000000 30
111111111000000222AAAAAAA0000000000 10 ZAB123
111111111000000222AAAAAAA0000000000 20
111111111000000222AAAAAAA0000000000 20
111111111000000222AAAAAAA0000000000 30
111111111000000222AAAAAAA0000000000 30
222222222000000111BBBBBBBB000000000 10 ABC999
222222222000000111BBBBBBBB000000000 20
222222222000000111BBBBBBBB000000000 30
222222222000000111CCCCCCCC000000000 10 ABC888
222222222000000111CCCCCCCC000000000 20
222222222000000111CCCCCCCC000000000 30
333333333000000333DDDDDDDD000000000 10 ABCKKK
333333333000000333DDDDDDDD000000000 30
After sort the output should be like this:
----+----1----+----2----+----3----+----4----....300----+----
222222222000000111CCCCCCCC000000000 10 ABC888
222222222000000111CCCCCCCC000000000 20
222222222000000111CCCCCCCC000000000 30
222222222000000111BBBBBBBB000000000 10 ABC999
222222222000000111BBBBBBBB000000000 20
222222222000000111BBBBBBBB000000000 30
111111111000000222AAAAAAA0000000000 10 ZAB123
111111111000000222AAAAAAA0000000000 20
111111111000000222AAAAAAA0000000000 20
111111111000000222AAAAAAA0000000000 30
111111111000000222AAAAAAA0000000000 30
333333333000000333DDDDDDDD000000000 10 ABCKKK
333333333000000333DDDDDDDD000000000 30
222222222000000111CCCCCCCC000000000 10 ABC888
222222222000000111CCCCCCCC000000000 20
222222222000000111CCCCCCCC000000000 30
222222222000000111BBBBBBBB000000000 10 ABC999
222222222000000111BBBBBBBB000000000 20
222222222000000111BBBBBBBB000000000 30
111111111000000222AAAAAAA0000000000 10 ZAB123
111111111000000222AAAAAAA0000000000 20
111111111000000222AAAAAAA0000000000 20
111111111000000222AAAAAAA0000000000 30
111111111000000222AAAAAAA0000000000 30
333333333000000333DDDDDDDD000000000 10 ABCKKK
333333333000000333DDDDDDDD000000000 30
Is it possible to do this with syncsort ? Can you please help ?
Regards,
kvn