Krisprem's "solution" will not work and does not handle the records as variable-length (he pads them out with blanks which is not what you want to do with variable-length records). This DFSORT/ICETOOL job will do what you asked for: