Hi guys
When comparing "0" = "00" character datatypes, why does datastage insist that the values are equal? Is DS converting the chars to internal numeric values before comparing?
I have tried CRC32 and CHECKSUM on the values and when comparing they are definitely not the same. Whats going on behind the scenes?
string "0" = "00" but integer 0 = 00
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 385
- Joined: Wed Jun 16, 2004 12:43 pm
- Location: Virginia, USA
- Contact:
Behind the scene, DataStage is performing a character to numeric conversion before the comparison. To force a character comparison, use the Compare() function.
Chuck Smith
www.anotheritco.com
www.anotheritco.com
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Only if both arguments are numeric.
Conceptually:
Conceptually:
Code: Select all
If Num(Arg1) And Num(Arg2)
Then
Result = Compare(Arg1, Arg2, "R")
End
Else
Result = Compare(Arg1, Arg2, "L")
End
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.