Error in Stagevariable

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
basu.ds
Participant
Posts: 118
Joined: Tue Feb 06, 2007 12:59 am
Location: Bangalore

Error in Stagevariable

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Please delete your duplicate post before anyone replies to it.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Too late. Argh... deleted my reply. Duplicate posts actually. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply