It's not clear at all what you're trying to do. You're using the default edit mask of M0 which is probably not what you want. All you show is the output you received. That doesn't tell us what output you actually want.
You need to show an example of your input and what you expect for output. Explain the rules for getting from input to output. Give the RECFM and LRECL of the input file.
DO NOT post downloads and/or screenshots. Just show the text with code tags around it.
Also, please run this job and show us the //SYSOUT messages so we can see what level you're at: