I like to see code so here is how an example would look:
Read in first 4 bytes as hex.
Sortout - convert hex to 8 characters.
The out file will be 8 bytes in this case.
-------------------------------
SORT FIELDS=(1,4,BI,A)
OUTFIL FILES(OUT),
OUTREC=(1:1,4,HEX)
END
-------------------------------