String to Integer

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
subbuvp
Participant
Posts: 15
Joined: Tue Feb 21, 2006 2:07 am

String to Integer

Post 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
DSGuru79
Charter Member
Charter Member
Posts: 12
Joined: Thu Nov 09, 2006 8:57 pm

Re: String to Integer

Post 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
DSGuru79
umamahes
Premium Member
Premium Member
Posts: 110
Joined: Tue Jul 04, 2006 9:08 pm

Re: String to Integer

Post by umamahes »

First use Trim function to remove leading and trailing spaces and then apply String To Decimal function.
HI
BalageBaju
Participant
Posts: 34
Joined: Fri Sep 22, 2006 10:59 pm
Location: India

Post 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.
Regards,
Balaji.
Post Reply