[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnubol: The sign-nibble question



"William M. Klein" wrote:

> OBVIOUSLY, this also impacts the "rules" for packing and unpacking numbers.
> If you use the same sign-nibbles in DISPLAY and PACKED-DECIMAL numbers, life
> is easier for these rules - on the other hand, it (usually) means that the
> usage display numeric signed and unsigned fields aren't the same - or have
> other peculiarities.

Display numeric fields without sign are filled with the numerals 0 - 9, in
EBCDIC x"F0" - X"F9". Any other value is invalid.

Display numeric fields with sign are filled in all bytes exept the byte at the
highest address with the numerals 0 - 9, in EBCDIC x"F0" - X"F9". The last byte
contains the sign in the left nibble as you have described.

The PACK instruction places the sign nibble from the DISPLAY field in the right
nibble of the receiving field, all other nibbles are filled with the right
nibble values of the sending field. Conclusion : all possible sign values in a
DISPLAY field are also used in packed decimal fields.

If you are willing to support files coming from mainframes you should consider
to support these sign values also.

Regards,

Fred Mobach




--
This message was sent through the gnu-cobol mailing list.  To remove yourself
from this mailing list, send a message to majordomo@lusars.net with the
words "unsubscribe gnu-cobol" in the message body.  For more information on
the GNU COBOL project, send mail to gnu-cobol-owner@lusars.net.