Hi,
In a transform job, I try to compare 2 stage variables containing a string value. Here are an exemple of my problem...
The first variable value is : "00E019"
The second variable value is : "00E017"
The problem is that the following verification : If Var1 = Var2
return always true. The reason is because DataStage is taking the "e" as a Exponent.
I don't want a mathematical compare between this 2 strings but a real string compare.
Can some one help me on this one.
Thanks.
String compare
Moderators: chulett, rschirm, roy
Haven't seen that problem before, but if that's really the problem you can try one of the 'string' functions noted in the BASIC manual pdf. Specifically, the SCMP function:
Code: Select all
Use the SCMP function to compare two string numbers and return one of the
following three numbers: -1 (less than), 0 (equal), or 1 (greater than). If
string.number.1 is less than string.number.2, the result is 1. If they are equal, the
result is 0. If string.number.1 is greater than string.number.2, the result is 1. You can
use this function in any expression where a string or string number is valid.
Either string number can be a valid number or string number. Computation is
faster with string numbers.
If either string number contains nonnumeric data, an error message is generated
and 0 is used instead of the nonnumeric data. If either string number evaluates to
the empty string, null is returned.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Re: String compare
Hi,
Concatenate with "*"
Var1 "*" : "00E019"
Var2 "*" : "00E019"
if Var1 = Var2 then @true else @false
Thanks
Concatenate with "*"
Var1 "*" : "00E019"
Var2 "*" : "00E019"
if Var1 = Var2 then @true else @false
Thanks
satya