Like Steve my first reaction was also that the hardware only knew about signed packed decimal and that unsigned packed was just a software convention; but I looked at z10 Principles of Op, and it explicitly defines both signed and unsigned packed decimal as zArchitecture data formats. In addition to the ancient Move With Offset, which POp mentions as user of unsigned packed, apparently some of the newer Decimal Floating Point instructions (Convert To/From Unsigned Packed) also work with unsigned packed decimal values. Since MVO never really cared about nibble content at all, it seems a stretch to say it represents support for packed decimal, signed or unsigned; but the newer DFP instructions, which actually force/require valid decimal nibbles, are clearly true hardware support for unsigned packed decimal.
    Joel C Ewing

On 04/24/2013 10:34 AM, Steve Comstock wrote:
On 4/24/2013 9:19 AM, John Gilmore wrote:
My understanding of the difference between unsigned and signed packed
decimal values is that the rightmost sign nibble in a signed packed
value is occupied by a digit in an unsigned value.

Consider a four-byte value.  The hardware interprets a signed value as

|d|d|d|d|d|d|d|s|, a precision of 7 decimal digits.

and an unsigned one as

|d|d|d|d|d|d|d|d|, a precision of 8 decimal digits.

No. The hardward does not recognize any such animal as an unsigned
packed decimal digit. All packed decimal data carries a sign in
the rightmost hex digit; x'A', x'C', x'E', and x'F' are considered
to be positive, x'B', x'D' are considered to be negative, x'0'=x'9'
are considered invalid and will abend you if you try to use such
data in any packed decimal operation.


They are thus easy to distinguish: the decimal digits are in the
sequence 0000, 0001, . . . 1001; and the signs are  the [logically]
larger four-bit values.

Vide pp. 9-2ff of the PrOp.

I do not recommend mixing them.

The OP is not considering mixing them but is considering the
vagaries of converting between packed and character numeric strings.


John Gilmore, Ashland, MA 01721 - USA







--
Joel C. Ewing,    Bentonville, AR       [email protected] 

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to