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
Pagadrai
Participant
Posts: 111
Joined: Fri Dec 31, 2004 1:16 am
Location: Chennai

Re: Error in stagevariable

Post by Pagadrai »

basu.ds wrote: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
Hi
Hope ur issue is resolved by now
Anyway, i think the problesm here is with datatypes.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There is no problem - they are the same.

In server jobs there are no data types. So a comparison tests each operand to determine whether or not they are numeric. If they are, a numeric comparison is performed - if not, a string comparison is performed.

To force a string (or numeric) comparison use the Compare() function, or force each operand to be a string by concatenating the same non-numeric string to each.
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 »

And please learn that there's no need to explicitly set the output for a Boolean. All you need is "trans.empno=mast.empno" for the derivation, that "if-then-else" construct (while it does 'work') is completely unnecessary.
-craig

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