Here is one of the few times it is valid to specify an even number of digit selexct bytes in an ED/EDMK mask
EDTIME CSECT
USING *,12
SAVE (14,12),,*
LR 12,15
TIME DEC
ST 0,PDTIME
ED DISPTIME,PDTIME
LA 0,L'MSG
LA 1,MSG
TPUT (1),(0),R
RETURN (14,12),T,RC=0
DC 0F'0'
PDTIME DC PL4'0'
MSG DC 0C'IT IS NOW HH:MM:SS.TH'
DC C'IT IS NOW'
DISPTIME DC 0C' HH:MM:SS.TH'
DC C' ',X'2120',C':',X'2020',C':'
DC X'2020',C'.',X'2020'
END EDTIME
The reason this works is the TIME DEC macro returns the time of day as 8 packed decimal digits. The ED instruction converts all 8 digits to EBCDIC numeric characters..
Notice, too, how I form the edit mask. The 0C' HH:MM:SS.TH' does not generate any storage. It just documents what I want the edit mask to look like. The C' ',X'2120',C':',X'2020',C':' and the next line are the actual edit mask. In real programs I usual form the three line in one long line, but because of the restricted width of the code block here I wrote 3 shorter lines. My method also means I do not need to knowthe EBCDIC codes for the non digit select characters.
The program does not use a new save area. The TIME and TPUT macros generate an SVC and does not require a save area