Page 1 of 1

Error in Stagevariable

Posted: Wed Nov 05, 2008 10:14 pm
by basu.ds
Hi

I have written on stagevariable but it is giving me wrong result can any help me on this

mystagevariable if trans.empno=mast.empno then 1 else 0

both columns are varchar columns
trans.empno=00000802 (value coming from hash file)
mast.empno=802 (value coming from oracle stage)
but data stage shows both are same i am wondering how?

Thanks in advance

Posted: Thu Nov 06, 2008 7:04 am
by ray.wurlod
DataStage BASIC resolves the "equals" operator as

Code: Select all

If Num(A) And Num(B) Then ((B-A) = 0) Else (A = B)
That is, it performs a numeric comparison if both operands are numeric. You can force a string comparison using a Compare() function or by concatenating something non numeric (the same something, of course) to each operand.

Posted: Thu Nov 06, 2008 7:07 am
by ray.wurlod
Please delete your duplicate post before anyone replies to it.

Posted: Thu Nov 06, 2008 7:54 am
by chulett
Too late. Argh... deleted my reply. Duplicate posts actually. :?