[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnubol: The sign-nibble question
Has the project decided what to do about the "sign-nibble question"? (This
was mentioned in passing in one of my other notes, but I haven't seen any
reply to that part of the note, so I thought I would start a new thread on
this issue.)
Although this CERTAINLY will impact how you handle packed-decimal items (when
you get to that), it really is required even for "embedded" signs in USAGE
DISPLAY numeric items.
Background (which I assume many - but possibly not all of you know)
The sign-nibble for an unsigned (display) number in ASCII is X"3" - in EBCDIC
it is X"F". Some PC (and UNIX) systems also treat X"3" as the positive
indicator; others support X"4". EBCDIC uses X"C". Negative in most PC
implementations is X"5" and EBCDIC is X"D". (IBM mainframes also allow - but
do not usually use X"E" as positive and X"B" as negative - I can't remember
what X"A" is, but could look it up if anyone cares.)
Micro Focus (and possibly some other PC vendors) has a "sign" directive to
determine which set of sign-nibbles are in use. This can get a little tricky
when you get things like:
05 Num1 Pic 9 Value 3.
05 Num2 redefines Num1 Pic S9.
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.
I have no immediate suggestion on which way to go with this question, but did
think it should be thought about "sooner" rather than later.
--
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.