Page 1 of 1

How to Exract only number from alphanumeric

Posted: Fri Oct 27, 2006 11:35 pm
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.

Posted: Sat Oct 28, 2006 2:08 am
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.

Posted: Sat Oct 28, 2006 7:29 am
by ambasta
Thanks a lot Kumar.My problem is resolved now.

Posted: Sun Oct 29, 2006 1:27 pm
by juliyas
ambasta wrote:Thanks a lot Kumar.My problem is resolved now.
Oconv(Input.column,"MTS") - retrieve the numeric data from the field

Posted: Sun Oct 29, 2006 2:17 pm
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.

Posted: Sun Oct 29, 2006 3:00 pm
by chulett
ray.wurlod wrote:Had the OP wanted to use Oconv(), the second argument would be "MCN"
a.k.a. the DIGITS transform.