Force comparing strings when they contain numbers

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
moose2079
Premium Member
Premium Member
Posts: 48
Joined: Tue Mar 07, 2006 4:52 pm
Location: Australia

Force comparing strings when they contain numbers

Post by moose2079 »

Hi there,
During the Load to our Involved Party(IP) table we compare incoming fields to what is on the IP table One field we compare is a Varchar 20 field - we compare that to the incomming varchar 20 field .. if different then update. I have the incomming field set to 000000 and the IP value set to 0. They are different butDataStage returns them as the same - so I am guessing DataStage compares as numbers to optimise performance ... problem is I simply want a string comparison - I have tried str, substrings with no success - they still match - How do I force DataStage t5o compare as string '00000' to string '0' and come back and say they are different? - my current code follows .....
Substrings(In_FDW.FDW_MEID,1,len(In_FDW.FDW_MEID)) = Substrings(In_FDW.MEID,1,len(In_FDW.MEID))

Please advise

:-)
YUM
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Use Compare() function specifying "L" (left-justified) as the third argument.
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