That rule would be compiler specific, while the FACE / BD is Pack Decimal
specific (mainframe / ?other?).

On Mon, Apr 28, 2025 at 11:41 AM Phil Smith III <[email protected]> wrote:

> Ah, so the "unsigned" thing is COBOL-specific? That would explain the
> confusion/varied answers!
>
> Heh, "FACE positive, B&D negative" sounds more like something from a NSFW
> discussion...(it's Friday, right? Somewhere?)
>
> -----Original Message-----
> From: IBM Mainframe Discussion List <[email protected]> On Behalf
> Of Schmitt, Michael
> Sent: Monday, April 28, 2025 12:33 PM
> To: [email protected]
> Subject: Re: Packed decimal sign nibbles
>
> Same here: F A C E are positive, B & D are negative.
>
> The machine doesn't have an "unsigned" packed sign nybble. It is either
> positive or negative. So "F" is positive as a sign nybble, or it is the
> "zone" in other positions in a zoned decimal number.
>
> "F" is unsigned, however, in IBM Enterprise COBOL for z/OS: when you
> compile with NUMPROC(PFD) it is *very* strict: there are only three valid
> signs:
>
> C: positive
> D: negative
> F: unsigned
>
> If all your code has preferred signs then it can generate more efficient
> code, by using CLC and MVC for example instead of packed decimal
> instructions.
>
>
> -----Original Message-----
> From: IBM Mainframe Discussion List <[email protected]> On Behalf
> Of Phil Smith III
> Sent: Monday, April 28, 2025 11:26 AM
> To: [email protected]
> Subject: Re: Packed decimal sign nibbles
>
> Ok, well, in 1975 I was still in high school and playing games on VM over
> dialup, didn't start my mainframe career until 1980. But the question
> stands: what's with these "unpreferred" values? Why would they even
> exist/be valid?
>
> -----Original Message-----
> From: IBM Mainframe Discussion List <[email protected]> On Behalf
> Of Lennie Bradshaw
> Sent: Monday, April 28, 2025 12:21 PM
> To: [email protected]
> Subject: Re: Packed decimal sign nibbles
>
> That's exactly as I was taught in about 1975.
> Lennie
>
> -----Original Message-----
> From: IBM Mainframe Discussion List <[email protected]> On Behalf
> Of Phil Smith III
> Sent: 28 April 2025 17:17
> To: [email protected]
> Subject: Packed decimal sign nibbles
>
> A friend asked me about packed decimal sign nibbles, specifically x'0F'. I
> said "Unsigned" was what I'd always been told. He said he was finding
> varied answers, and then pointed me at SA22-7832-03 (PofOp, but an old
> version from 2004) where, on page 8-2 (PDF page 1150) is the following
> table. It displays correctly in monospace font, so hopefully you can read
> it:
>
>          Recognized As
>  Code
> (Binary) Digit    Sign
> -------- -------  -------
>  0000    0        Invalid
>  0001    1        Invalid
>  0010    2        Invalid
>  0011    3        Invalid
>  0100    4        Invalid
>  0101    5        Invalid
>  0110    6        Invalid
>  0111    7        Invalid
>  1000    8        Invalid
>  1001    9        Invalid
>  1010    Invalid  Plus
>  1011    Invalid  Minus
>  1100    Invalid  Plus (preferred)
>  1101    Invalid  Minus (preferred)
>  1110    Invalid  Plus
>  1111    Invalid  Plus (zone)
>
> X'0A'? X'0B'?? X'0E'??? I'd only ever heard of x'0C', x'0D', and sometimes
> x'0F'. Is it just me? I certainly don't claim to be Mr. Packed Decimal, but
> I have encountered it off and on over the last 45 years, so I was very
> surprised.
>
> I do see the discussion of "zones" in that section of the book, but that
> doesn't clarify for me because zones have always been a mystery to
> me--never needed to grok them. And it still doesn't explain the other
> values.
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions, send email
> to [email protected] with the message: INFO IBM-MAIN
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions, send email
> to [email protected] with the message: INFO IBM-MAIN
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions, send email
> to [email protected] with the message: INFO IBM-MAIN
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions, send email
> to [email protected] with the message: INFO IBM-MAIN
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>


-- 
Mike A Schwab, Springfield IL USA
Where do Forest Rangers go to get away from it all?

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to