The Issue here is that for record 1A, A2009 (5 byte field) starts at position 22, but for records 1N, it starts at position 29. This 5 byte field always occur at position 22 for records 1A and at position 29 for record 1N and so on. The field contians lots of different values. I want to sort the file based on this 5 byte field but it occurs at different positions for different records (1A,1N,1B ..so on)
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
You can use the DFSORT technique below to do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes. You can add as many IFTHEN clauses as you need to handle the different record types.