Joined: 14 Jan 2008 Posts: 2504 Location: Atlanta, Georgia, USA
Ultimately, you'd have to UNPACK the data into a display-workarea large enough to hold the number, such as a CL16.
Then, test the source-field of this data and determine of it's positive or negative and insert the appropriate sign in the 1st-byte of the CL16.
If the source-data is in a halfword or fullword, then you're going to have to load it into a work-register and issue a CVD into an aligned-doubleword, with the sign-nibble resolving to either a 4-Bit "C" or "D", with the latter representing a negative value.
Now, you could be fooled if the halfword value exceeds 32767, but it really represents a positive value, such as 65535. So, I would move the halfword to the low-order of a fullword work-area, clear the high-order of the fullword to X'0000' and then load this fullword into the work-register, followed then by the CVD.
To me, this is an easy method and you don't need to define an edit-pattern and use the ED instruction (YUK!).