This is not an appropriate place for a tutorial, but I'll try.
- There are three classes of characters in an ED instruction “mask:”
- A fill character, always the first character in the “mask.” The fill character replaces digit select and text characters.
- Two types of digit select characters.
- A regular digit select character, X'20'.
- A significance start digit select character, X'21'.
The ED instruction replaces digit select characters with an EBCDIC numeric character or the fill character. An EBCDIC numeric character is used if the corresponding packed decimal digit is non-zero, or a preceding digit select character inserted a number. The fill character is used if the corresponding packed decimal digit is 0. The significance start digit select character sets a switch that implied a non-zero packed decimal digit has been encountered - A text character. Text characters are replaced with the fill character if significance has not been established.
I do not use ED very often in my own work, so I've never memorized the hexadecimal codes for many common text characters like comma (,). I construct my edit mask using compound DC statements like
EDMASK DC 0C'bNN,NNN',C'b',X'2020',C',',X'202120'
The lower case b is really a blank, because blanks do not display well here.
The 0C'bNN,NNN' part is a simplified mask that describes the real mask.
C'b' is the fill character.
X'2020',C',',X'202120' is the digit select characters and an imbedded text character.
An important detail is most real world edit "masks" contain an odd number of digit select characters because
all real packed decimal characters contain an odd number of digits.
So
ED EDMASK,=PL3'99999'' generates C'b99,999'
ED EDMASK,=PL3'1024' generates C'bb1,024'
ED EDMASK,=PL3'0' generates C'bbbbbb0'
Text characters that follow the last digit select character are replaced with the fill character if the packed decimal sign is a preferred or alternate +.
Historically there have been two simplified mainframe simulators for PCs.
- PC370 - PC370 is a 16-bit MS-DOS application. It should run in Windows XP, but not Vista or Win 7.
- z390.org - z390 is a Java application. Its principal author appears to be the primary author of PC370.
I can't vouch for either product.