CUSTOUT DC CL6' CUSTOMER ID'
The prototype data obviously contains more than 6 characters! The assembler will just process the first 6.
I just picked one example. You'll have to do the remainder.
MVC TOTLOUT(6),=XL6'40206B2020214B2020'
ED TOTLOUT(6),$TTOTAL
ED TOTLOUT(6),$TTOTAL
Lot's of problems.
- The prototype edit mask obviously has more than 6 characters. You need to define a large enough output area.
- You need to specify one digit select character (X'20' or X'21') for each digit in the packed decimal number you're editing. Your complete prototype edit mask just has 6 digit select characters. $TTOTAL, on the other hand, has 9 digits.
- Except for very simple cases, I quit using literals for an edit mask. They are too hard to examine, and it is too easy to make a mistake.
- The X'21' digit select does not immediately insert a 0; it starts with the next character.
MVC TOTLOUT,EDMASK
ED TOTLOUT,$TTOTAL
* -----+----1--
EDMASK DC 0C' N,NNN,NNN.NN'
DC C' ',X'20',C',',X'202020,C',',X'202120'
DC C'.',X'2020'
...
TOTLOUT DC CL(L'EDMASK)' '
ED TOTLOUT,$TTOTAL
* -----+----1--
EDMASK DC 0C' N,NNN,NNN.NN'
DC C' ',X'20',C',',X'202020,C',',X'202120'
DC C'.',X'2020'
...
TOTLOUT DC CL(L'EDMASK)' '
I first define what I want the output to look like as a 0C'...' data area. This is more for documentation and to define a length. Then I construct the edit mask. When I want to specify a real character, I break the digit selects and insert the character using C'character'. Now I do not want to claim I never make a mistake here, but it's usually easier to find and correct the goof than when you use a literal.