I can't speak to OP's situation, but we have packed fields containing only digits; we have to convvert using, e.g. MVO, before doing arithmetic with them. I'm curious as to what support COBOL and PL/I have for that format.
-- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 עַם יִשְׂרָאֵל חַי נֵ֣צַח יִשְׂרָאֵ֔ל לֹ֥א יְשַׁקֵּ֖ר ________________________________________ From: IBM Mainframe Discussion List on behalf of Bernd Oppolzer Sent: Friday, May 2, 2025 9:07 AM To: [email protected] Subject: Re: Packed decimal sign nibbles External Message: Use Caution I would like to understand for the clarity of this discussion what you mean by unsigned packed decimal data; is it simply pic 9(8) comp-3, where the internal representation has a sign nibble which should be always positive, or is it (as often present in reality) a CHAR field containing decimal digits WITHOUT a sign nibble which neads byte twiddling to convert this to a usable number (which is TRUE UNSIGNED ... at least IMHO)? Thanks, have a nice day Bernd Am 02.05.2025 um 14:30 schrieb Seymour J Metz: > That's the right answer to the wrong question. OP asked about the generated > code, not about the requirements of specific instructions. Lots of > applications deal with unsigned packed decimal, and, yes, it requires more > instructions than signed packed decimal. > > -- > Shmuel (Seymour J.) Metz > http://mason.gmu.edu/~smetz3 > עַם יִשְׂרָאֵל חַי > נֵ֣צַח יִשְׂרָאֵ֔ל לֹ֥א יְשַׁקֵּ֖ר > > > > ________________________________________ > From: IBM Mainframe Discussion List on behalf of Robin Vowels > Sent: Friday, May 2, 2025 7:34 AM > To: [email protected] > Subject: Re: Packed decimal sign nibbles > > > External Message: Use Caution > > > On 2025-05-02 18:45, Andrew Rowley wrote: >> On 2/05/2025 1:22 pm, Tom Ross wrote: >>> Hmm, if you don't want a sign, why have an 'S' in the PICTURE clause? >>> Signed: >>> 05 SIGNED-ITEM PIC S9(x) COMP-3. >>> Unsigned: >>> 05 UNSIGNED-ITEM PIC 9(x) COMP-3. >>> >>> I guess I am too close to COBOL, but signed and unsigned are easy in >>> COBOL! >> What's the difference in the representation? >> Is unsigned 1234: >> 0x01234F >> or >> 0x001234 > To be handled by the hardware, the least-significant nibble > must contain the sign. > Unsigned would contain a plus sign in this nibble. > > ---------------------------------------------------------------------- > 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
