Hi
I have some doubts with Date Functions.
Many of the Built-in Date Transforms like TAG.TO.YEAR etc returns varchar.I want to apply some arithmetic functions on these results.
Is there any way to convert these varchar to integer.
Also What do the functions Num,Int Return?
Thanks & Regards
SumA
Conversion-Varchar to Integer
Moderators: chulett, rschirm, roy
Hi Suma,
You can very well arithmetic functions as a type conversion will be done implicitly. The function Num(STRING) will return success if the string supplied can be converted to a number. This can be used for validating the string. I don't know if there is a function with name 'int' is there.
You can very well arithmetic functions as a type conversion will be done implicitly. The function Num(STRING) will return success if the string supplied can be converted to a number. This can be used for validating the string. I don't know if there is a function with name 'int' is there.
Vignesh.
"A conclusion is simply the place where you got tired of thinking."
"A conclusion is simply the place where you got tired of thinking."
Hello SumA,
DataStage will implicitly perform a string-to-integer conversion when you attempt to perform a mathematical operation to a string; in fact this is one of the features that makes DS such a powerful tool. Of course the conversion will have problems if the string doesn't contain a number and you attempt to subtract something from it. In the case of the functions that return a "2005" type year string you can use it as it if were a number.
DataStage will implicitly perform a string-to-integer conversion when you attempt to perform a mathematical operation to a string; in fact this is one of the features that makes DS such a powerful tool. Of course the conversion will have problems if the string doesn't contain a number and you attempt to subtract something from it. In the case of the functions that return a "2005" type year string you can use it as it if were a number.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>