Page 1 of 1

Doubt regarding Datastage String Function

Posted: Thu Mar 26, 2009 1:53 am
by balu536
Hi,
I have a doubt in using the Compare function in Datastage.
This function is used as

If (Compare (Trim(EXSTCRR_TRANS.MW , '0' , 'R') ,'.' ) = 0) Then 0 Else 1

If (Compare (Trim(EXSTCRR_TRANS.MW , '0' , 'R') ,'' ) = 0) Then 0 Else 1

What's the actual output of this function in the scenario mentioned above


Also if we are using If funtion as mentioned below please explain whether is it performing AND r OR operation

If (VCZero = VIZero = VeInZero = 0) Then 0 Else 1

Regards,
Balakrishna

Posted: Thu Mar 26, 2009 3:40 am
by ray.wurlod
Try it and find out, and let us know.

My guesses (since I'm not in a position to try) would be indeterminate for the Compare() functions because I don't know what the value of EXSTCRR_TRANS.MW is. Once you've done a Trim() you have a string, so you don't actually need the Compare() function - you're doing a string comparison anyway.

I expect that the operators in your third example will associate pairwise from the left.

Code: Select all

If (((VCZero = VIZero) = VeInZero) = 0) Then 0 Else 1 

Posted: Thu Mar 26, 2009 5:26 am
by balu536
MW contains Decial values like
11.00,0.166,0.207,221.376 etc.With these values can you please let me know the outcome


Regards,
Balakrishna

Posted: Thu Mar 26, 2009 2:18 pm
by ray.wurlod
No, because I don't currently have access to Enterprise Edition.

YOU try it, and let us know. I can only guess.