jerryte
Active User
Joined: 29 Oct 2010 Posts: 202 Location: Toronto, ON, Canada
|
|
|
|
I want to share a hard learned lesson with others so hopefully they can avoid the same error. I had the below REXX logic
Code: |
IF key <> prev_key THEN DO
/* do something */
key = prev_key
end |
When I ran this with a 15 character key consisting of all digits it would sometimes fail even though the values were different. REXX was treating the string as a number and would shorten it to the default 11 numeric digits before doing the comparision.
To work around this I used the below
Code: |
IF key \== prev_key THEN DO
/* do something */
key = prev_key
end |
This seems to force REXX to treat the variables as a string instead of a number.
The other solution would be to specify NUMERIC DIGITS 15
Comments? Suggestions? |
|