Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CONVERTION DECIMAL IN PACKED NUMBERS

0 views
Skip to first unread message

Andrea Monaci

unread,
Jan 31, 1999, 3:00:00 AM1/31/99
to
HI

How does you become to convert by hand a decimal number in a Packed decimal
or BCD (Binary Coded Decimal) number?

THANKS

BYE

P.S: You could me write it the answered to this address amo...@protec.it

Andrea Monaci

My address is:

Via A.Gramsci N. 96
C.A.P.: 35010 Cadoneghe (Padova) (Italy)
Tel/Fax: 0039-049700637
E-Mail: amo...@protec.it

wouter wijker

unread,
Jan 31, 1999, 3:00:00 AM1/31/99
to


Well, at the risk of not completely understsnding the question.

A numeric item, lets say 1234 is internally represented by
8 bits bytes.
The byte=code for a character '1' is X'F1', for a '2' is X'F2' etc.
(Assuming EBCDIC-code.)
The internal representation of 1234 is therefore X'F1F2F3F4'. (4 Bytes)

A packed decimal strips the F nibble of the byte and adds a sign.
F1F2F3F4 becomes X'01234F'. (3 bytes)
The last nibble is the sign, a F is unsigned, D and C are used for
negative and positive.
Any Cobol manual will probably put you on the right track of the correct
layout.

0 new messages