- You cannot have a "file" with FB=100; you probably have a dataset with RECFM=FB, and LRECL=100? Or did you mean something else?
- Both RECFM, and LRECL have nothing to do with your task. If you do not understand this then I can only suggest: switch to the Beginners Forum
The solution in SORT seems to be extremely primitive (if you have ever tried something with SORT).
- Use IFTHEN=(WHEN=(28,1,CH,EQ,C'M'), etc.
- Use function MUL to calculate KBytes from MBytes
- Use function DIV (or MOD) to calculate KBytes from Bytes
- Use BUILD parameters to create new records in 3 different manners
- Options EDIT= (and others) might help you to format your output record properly
Any further details would mean doing your job instead of yourself, for free. Be looking for others to dupe.