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

Re: [GNU-COBOL] New to list



Boris Kortiak wrote:

> >>> Fred Mobach <fred@mobach.nl> 10/28/99 11:23AM >>>
> <snip>
> > > If the field is in USAGE IS COMP-3 format (the well-known BCD code
> > > format) each byte holds two digits.
> >
> > Except the rightmost byte which holds one plus a sign indicator, as you
> > mentioned above.
>
> Saw this construction ( PIC 9(n) USAGE IS COMP-3) on Bull mainframes long ago.
> Those systems could work with unsigned packed decimal and called it BCD
> arithmetic.
>
> Actually this is an extension I have seen mostly with Burroughs.  I have also seen a COMP-6 extension (mbpCOBOL of Germany) for unsigned BCD.  It's nice to have when you don't need a sign, but not an absolute requirement.

It's indeed not so important for new programs but try to imagine what the consequences are for converting old programs that use that kind of fields in redefined area's :

01  AREA.
     03  GROUP1.
        05  FIELD1   PIC XX.
    03  FILLER REDEFINES GROUP1.
        05  NUMFIELD1 PIC 9(4) COMP-3.

Without the sign in NUMFIELD1 both groupfields are 2 bytes long. With the sign in NUMFIELD1 the group FILLER is 3 bytes long. It's a hassle to convert this kind of constructions and you can find them anywhere :-).

Regards,

Fred


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