× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 5/13/2013 8:25 PM, Barbara Morris wrote:
On 5/13/2013 10:47 AM, CRPence wrote:
...
Does that claim imply that the 12 byte string [with character b
representing blanks] 'bbbbbb-79349', when stored in a zoned decimal
variable, will compare as less than a zero value? Please tell me that is
not so!


As requested, "That is not so." :-)

'bbbbbb-79349' would be handled the same as '000000079349', so it would
not compare less than 0.

'bbbbbb-79349' = x'40404040404060F7F9F3F4F9'

The zones are ignored for the first N-1 bytes, so this is the value
that's used:
'bbbbbb-79349' = x' 0 0 0 0 0 0 0 7 9 3 4F9'

'000000079349' = x'F0F0F0F0F0F0F7F9F3F4F9'

The zones are ignored for the first N-1 bytes, so this is the value
that's used, same as the one with the zeros:
'000000079349' = x' 0 0 0 0 0 0 0 7 9 3 4F9'

The reference I'd cite: 'If you move a character field to a zoned
numeric, the sign of the character field is fixed to zoned positive or
zoned negative. The zoned portion of the other bytes will be forced to
'F'. However, if the digit portion of one of the bytes in the character
field does not contain a valid digit a decimal data error will occur.'

ILE RPG Reference, IBM i 7.1 Information Center > Programming >
Programming languages > RPG > ILE RPG Language Reference > Definitions >
Chapter 9. Data Types and Data Formats > Numeric Data Type >
Considerations for Using Numeric Formats
http://pic.dhe.ibm.com/infocenter/iseries/v7r1m0/topic/rzasd/sc092508280.htm

--buck

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.