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

Re: [GNU-COBOL] New to COBOL



Boris Kortiak wrote:

> David,
>
> Please forgive the GroupWise lousy quoting.  I will prefix statements with -DO for Davyd, -DN for you and -BK for me.
>
> -DN
> Packed decimal means storing one digit in each nybble or your data,
> right?  Perl can unpack arbitrary data into hex nybbles using
> the h or H "pack templates" and then evaluate the results as numbers
> (into the native perl number type, which is double-precision floating
> point,
> which can cause inaccuracies, so a big integer package would be called
> for, or perhaps adjusted as needed)
>
> -BK
> All numbers in COBOL are essentially INTEGER types.  It is the internal storage method which changes.  The big problem with packed decimal is the sign.  A field defined as PIC S9, takes up a single by with the high-order nybble indicating the sign.  A field defined as PIC S999 takes up two bytes, with the high order nybble of the low-order byte indicating the sign.  In general the sign is the high order nybble of the low order byte.
>
> The current standard only allows numbers to have 18 digits: 123456789012345678 or 123456789.012345678 or .123456789012345678 or any other combination.  The sign and the decimal point don't count (at least for storage).

All numbers in COBOL are essentially INTEGER types ? NO.
I never used floating point numbers in Cobol, only in Fortran, Algol and so on. But on many systems from IBM, Siemens, Bull and so on you can use floating points in Cobol.


> Still find more work, more often in COBOL.
>
> Besides, it IS a heck of lot easier to maintain than any of the others, IMNSHO.

Thank you very much, it's one of the reasons for me to cooperate.

Regards,

Fred Mobach
fred@mobach.nl


--
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.