how to convert string to int in modifystage

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
arasan
Participant
Posts: 44
Joined: Wed Nov 30, 2005 3:54 am
Contact:

how to convert string to int in modifystage

Post by arasan »

required syntax to covert string to integer using modifystage
Nageshsunkoji
Participant
Posts: 222
Joined: Tue Aug 30, 2005 2:07 am
Location: pune
Contact:

Function to convert String to Integer

Post by Nageshsunkoji »

Hi,

The function for converting int16 to string as follows :

NewColumn:int 16 = lookup_int16_from_string(Old Column:String)

In case of remaining Integer type the convesrion from string to integer would be default i.e. No function required to convert String to Integer.

Regards
Nagesh.
NageshSunkoji

If you know anything SHARE it.............
If you Don't know anything LEARN it...............
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I would have thought some of the simpler functions, such as int16_from_string or int32_from_string, or uint32_from_string, would have been more appropriate.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

Yep, the lookup functions translate a list of strings into a specified set of integer values, you are better off with Ray's list of conversion functions.
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

ray.wurlod wrote:I would have thought some of the simpler functions, such as int16_from_string or int32_from_string, or uint32_from_string, would have been more appropriate. ...
Is int32_from_string and int16_from_string still available? I do not find it documented in version 7.5.1.

When i tried to use int32_from_string in the modify stage i get the following error:

Error in binding: Unknown conversion: int32_from_string
Post Reply