Doubt regarding Datastage String Function

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
balu536
Premium Member
Premium Member
Posts: 103
Joined: Tue Dec 02, 2008 5:01 am

Doubt regarding Datastage String Function

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

Post 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 
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
balu536
Premium Member
Premium Member
Posts: 103
Joined: Tue Dec 02, 2008 5:01 am

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

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply