Did you know that SORT is able to convert binary and packed fields into readable numbers? I did not. However it is quite easy to make SORT do such conversions. This makes it much easier to read a file filled with a lot of binary and packed fields. Just send it through SORT.
Now imagine a dataset containing a ten digit customer number stored as a packed field equal to a FIXED DECIMAL(10) in PL/I, DECIMAL(10) in DB2 or PIC 9(10) COMP-3/DECIMAL in COBOL followed by a count of transactions stored as a binary field equal to a FIXED BINARY(31) in PL/I, INTEGER in DB2 or PIC S9(9) COMP/BINARY in COBOL. This is complete nonsense to read and hard to search in using FIND in ISPF EDIT, unless you are fond of hexadecimal conversions and is an expert in the internal representation of packed fields. Instead you can choose to send the file through the following SORT step:
Each record in MY.READABLE.FILE will look like this:
I hope you understand the basics of how OUTREC operates otherwise click on help for OUTREC. Please note that OUTREC includes a function called EDIT which can be used to make even more sophisticated formatting than demonstrated above. For instance my formatting will not display a nice dash in front of a negative numbers, but instead display the last digit as a letter or special character. And you cannot display a decimal comma unless you use EDIT.