×
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 16/05/2009, at 7:25 AM, Jeff Young wrote:
Can someone explain why this does not work as I would expect?
Because you are requesting a character comparison.
*ZERO is a figurative constant. It will be expanded to match the size
of the other comparand. Therefore your code is equivalent to:
if '.1525' > '00000'
The "decimal point" in the left-hand comparand is x'4B' which is "less-
than" the x'F0' value of the first '0' in the right-hand comparand.
Trying:
if '0000.1525' > '000000000'
fails for a similar reason. '0000' matches '0000' but '.' is x'4B'
which is "less-than" the x'F0' value of the fifth '0' in the right-
hand comparand.
Using a value of ' 1.1525' will also fail without the triml
function. With triml you get:
if '1.1525' > '000000'
Since '1' (x'F1') is "greater-than" '0' (x'F0') the comparison is true.
Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software OS/400, i5/OS Technical Specialists
http://www.flybynight.com.au/
Phone: +61 2 6657 8251 Mobile: +61 0411 091 400 /"\
Fax: +61 2 6657 8251 \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------
As an Amazon Associate we earn from qualifying purchases.