Page 1 of 1

String to Integer

Posted: Mon Dec 11, 2006 10:13 pm
by subbuvp
Hi All,
The input is string ( the format is in within double quote "2006") and i need an output in integer( example: 2006).
How can we do it in Datastage Designer?
Please do help me to solve this....


Thanks and regards
Subbu

Re: String to Integer

Posted: Mon Dec 11, 2006 10:49 pm
by DSGuru79
subbuvp wrote:Hi All,
The input is string ( the format is in within double quote "2006") and i need an output in integer( example: 2006).
How can we do it in Datastage Designer?
Please do help me to solve this....


Thanks and regards
Subbu

Use basic functions, (check in transformer) to strip the quotes and then use stringtoDecimal fucntion

Re: String to Integer

Posted: Mon Dec 11, 2006 10:54 pm
by umamahes
First use Trim function to remove leading and trailing spaces and then apply String To Decimal function.

Posted: Mon Dec 11, 2006 10:58 pm
by BalageBaju
Subbu,

What is your source, If it is Sequential file set the Field Default-->Quote as Double. Then Datastage only takes the data only within quotes(2006).

To convert the string in to Integer, you can use the function "AsInteger".
This function treats the given input as integer.

Hope this will help you.