How to Exract only number from alphanumeric

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
ambasta
Participant
Posts: 93
Joined: Thu Jan 19, 2006 10:29 pm
Location: Bangalore

How to Exract only number from alphanumeric

Post by ambasta »

Hi All,
My requirement is to Populate only number for a column which can contain alphanumeric.The length of Column is 24 and dattype is Varchar.number and alphabets can come at any place.
Ex..if data is coming like hfkhfh12hje4344jbd4j then i need to populate only 1242444. or if input data is hjdghj342475jfhjf8 then i need to populate 3424758.Is there any inbuilt unction in datastage to do this.
Can anyone pleas help me on this and suggest me what i can do for this???Please help me.


Thanks in Advance.
ambasta
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Use Convert('abcdefghijklmnopqrstuvz','',Input.Col), you can add more character like any special character or you can even use Upper functon for case sensitive.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ambasta
Participant
Posts: 93
Joined: Thu Jan 19, 2006 10:29 pm
Location: Bangalore

Post by ambasta »

Thanks a lot Kumar.My problem is resolved now.
ambasta
juliyas
Participant
Posts: 14
Joined: Wed Feb 09, 2005 10:32 am

Post by juliyas »

ambasta wrote:Thanks a lot Kumar.My problem is resolved now.
Oconv(Input.column,"MTS") - retrieve the numeric data from the field
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Oconv() function is not natively available in parallel jobs. Oconv() with "MTS" is for working with Time data. Had the OP wanted to use Oconv(), the second argument would be "MCN" rather than "MTS", and it would be necessary to use a BASIC Transformer stage (or a server Transformer stage in a server shared container), either of which would have negative implications for throughput.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

ray.wurlod wrote:Had the OP wanted to use Oconv(), the second argument would be "MCN"
a.k.a. the DIGITS transform.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply