how to extract numeric data?

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
aaha_naga
Participant
Posts: 20
Joined: Wed Aug 23, 2006 5:15 am
Location: Chennai

how to extract numeric data?

Post by aaha_naga »

Hi
In transformer i am having one input column as varchar. in that field i have to extract the numeric digits from the input data.please let me know if any functions available for that?
:)
kishore2456
Participant
Posts: 47
Joined: Mon May 07, 2007 10:35 pm

Re: how to extract numeric data?

Post by kishore2456 »

What type of input is it exactly? It will be easier if you can post some sample data. Is it a mix of char & numerics?
FD
aaha_naga
Participant
Posts: 20
Joined: Wed Aug 23, 2006 5:15 am
Location: Chennai

Re: how to extract numeric data?

Post by aaha_naga »

kishore2456 wrote:What type of input is it exactly? It will be easier if you can post some sample data. Is it a mix of char & numerics?

Actually input field is varchar (10) and it contains julian date... now it have only numeric values.
ex: 35064,35884,1,
:)
Maveric
Participant
Posts: 388
Joined: Tue Mar 13, 2007 1:28 am

Post by Maveric »

If it is only "," then you can use the trim function. Not sure of the options but i think 'A' removes all occurences.

Trim(In.Col,',','A')
aaha_naga
Participant
Posts: 20
Joined: Wed Aug 23, 2006 5:15 am
Location: Chennai

Post by aaha_naga »

[quote="Maveric"]If it is only "," then you can use the trim function. Not sure of the options but i think 'A' removes all occurences.

Trim(In.Col,',','A')[/quote

hi

In my sample data 35064,35884,1.. here 35064 is coming in a row and viz versa. i hope you meant all in a single row. it has not like that. i mentioned my ip column scale is 10 only. i hope trim and field functions are not correct options.
:)
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

Your requirement is not clear.

Give sample input data and sample output data.

You had mentioned
ex: 35064,35884,1,
Do you have three columns in your input?
mcs_murali83
Participant
Posts: 23
Joined: Sat Sep 29, 2007 6:05 am
Location: Datastage
Contact:

Extracting Numeric data

Post by mcs_murali83 »

Hai,

One of u r column contains the varchar as its datatype. But you want to extract the numeric values.

There is an option in transformer stage, goto functions----->
As integer(columnname)
Murali
aaha_naga
Participant
Posts: 20
Joined: Wed Aug 23, 2006 5:15 am
Location: Chennai

Re: Extracting Numeric data

Post by aaha_naga »

mcs_murali83 wrote:Hai,

One of u r column contains the varchar as its datatype. But you want to extract the numeric values.

There is an option in transformer stage, goto functions----->
As integer(columnname)
murali
As integer is used to convert in to integer data type
:)
dsedi
Participant
Posts: 220
Joined: Wed Jun 02, 2004 12:38 am

Post by dsedi »

As said,Requirement is not clear!
since you said you need to do something in transformer,Trim could be the best choice.check the guide it has lot of options.

Edi
Post Reply