Conversion function

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
josemathew
Participant
Posts: 7
Joined: Tue Jul 24, 2007 4:08 am
Location: Bangalore

Conversion function

Post by josemathew »

Hi All,
I have a requirement in which i have to get only the numeric values from a string , which consistes of numeric as well as other characters.Eg: String is "A123-6S". From this i want only 1236. i.e, only the numeric part.

In Server edition we used OConv(String,"MCN") which gave only the numeric values.Here in EE , which conversion function can exactly give only numeric values.?

Thanks in advance

Jm
bkumar103
Participant
Posts: 214
Joined: Wed Jul 25, 2007 2:29 am
Location: Chennai

Post by bkumar103 »

you can try with convert function.
Birendra
josemathew
Participant
Posts: 7
Joined: Tue Jul 24, 2007 4:08 am
Location: Bangalore

Post by josemathew »

Thanks for the response..But here i need to remove all kind of alphabets and other symbols(like ., - , _ etc) from the string. We are not sure about the knd of characers present in the string. That is why here if we use the Convert function, the from list and replace list are not clear..


Please give more input..Any other function by which the conversion can be done easily..


Regards
Jm
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

For starters, stop thinking like a server developer.

You will have to create your own function. Test each character and, if its value falls between 48 and 57 inclusive append that character to the initially empty result variable.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
bkumar103
Participant
Posts: 214
Joined: Wed Jul 25, 2007 2:29 am
Location: Chennai

Post by bkumar103 »

If you dont have any definitive list of character then it would be better to create a parallel routine in C++ as Ray suggested and call from transformer. To check for the process for creating subrotine you can search the forum... Many input has been provided already.
Birendra
Post Reply