Transformer

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
sirishds
Participant
Posts: 18
Joined: Sat Jun 12, 2010 11:28 pm

Transformer

Post by sirishds »

I have a situvation where i need to drop the string present in the source coloum and load only the numeric values at the target

Source Target
abc100 100
a1000 1000
abcd10 10

Can any one help me out what appropriate function in transformet need to be used or without using transformer can we devlop a job.

Thanks
siri
peddidsx
Premium Member
Premium Member
Posts: 55
Joined: Wed Dec 26, 2007 8:20 am

Post by peddidsx »

Is there a scenario where the letters fall in between the numbers?
Rajesh Peddi
sirishds
Participant
Posts: 18
Joined: Sat Jun 12, 2010 11:28 pm

Post by sirishds »

peddidsx wrote:Is there a scenario where the letters fall in between the numbers?

No numeric followed by string.
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

If your input is file then use sed command in sequential file filter

Code: Select all

sed "s/[^0-9]//g" file
Or

If you have only alphabets then use Convert function

Code: Select all

Convert("abcd...zABC...Z","",Field)
Or

If you have alphabets and other characters

Code: Select all

svTmp=Convert("0123456789","",Field)
svNum=Convert(svTmp,"",Field)
You are the creator of your destiny - Swami Vivekananda
sirishds
Participant
Posts: 18
Joined: Sat Jun 12, 2010 11:28 pm

Post by sirishds »

anbu wrote:If your input is file then use sed command in sequential file filter

Code: Select all

sed "s/[^0-9]//g" file
Or

If you have only alphabets then use Convert function

Code: Select all

Convert("abcd...zABC...Z","",Field)
Or

If you have alphabets and other characters

Code: Select all

svTmp=Convert("0123456789","",Field)
svNum=Convert(svTmp,"",Field)

Hi,

Thanks for the immediate reply iam very clear with your first option i.e filter command supposed to use in the sequential file

How do i use the rest of the two functions,are these the functions in transformer

Thanks in advance
siri.
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Yes Convert function is for transformer
You are the creator of your destiny - Swami Vivekananda
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Code: Select all

Convert(Convert("0123456789 ","",yourString), "", yourString)
-craig

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