It's not clear what you want to do from your vague description. You need to give a much better explanation of what you want to do before anyone can help you.
Show an example of your input records (relevant fields only) and what you expect for the output records. Explain the rules for getting from input to output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of all relevant fields.