How to remove alphanumeric characters using 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
Prince_Hyd
Participant
Posts: 35
Joined: Mon May 06, 2013 5:59 am

How to remove alphanumeric characters using transformer?

Post by Prince_Hyd »

Hi Folks

i have a source like this

ID
122133@324
$324234423
$324342346

i want to remove those alphanumeric characters,how can i achieve it.


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

Post by ray.wurlod »

Let's be clear about what you mean by "alphanumeric".

In the industry this term is commonly understood to include alphabetic characters (letters) and numeric characters (digits).

I suspect that's not what you mean in this case.

A generic solution to preserve alphanumeric characters (as conventionally understood) uses the "double convert" technique discussed earlier.

Code: Select all

Convert(Convert("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", "", UpCase(InLink.TheString)), "", InLink.TheString)
which is what I suspect you desire.

To remove alphanumeric characters just use the inner Convert() function.

Code: Select all

Convert("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", "", UpCase(InLink.TheString))
In your example the result would be:

ID
@
$
$
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Prince_Hyd
Participant
Posts: 35
Joined: Mon May 06, 2013 5:59 am

Post by Prince_Hyd »

hey ray

sorry for that i dint noticed that properly i want to remove those symbols like @,$
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Then use the first of the solutions that I offered.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
crystal_pup
Participant
Posts: 62
Joined: Thu Feb 08, 2007 6:01 am
Location: Pune

Post by crystal_pup »

Use the convert function
Post Reply