how to separate alphabets and numeric values

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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Search here for the phrase "double convert", you can use two embedded Convert() functions to remove characters by providing a list to keep. For example, to keep all of the numerics:

Code: Select all

Convert(Convert('0123456789','',YourField),'',YourField)
The inner convert removes all numbers from your string, leaving just the non-numeric characters. The outer convert then removes the list of unwanted characters from your field.

Do the opposite by providing a list of the alphabetic characters you'd like to keep.
-craig

"You can never have too many knives" -- Logan Nine Fingers
srinivas.nettalam
Participant
Posts: 134
Joined: Tue Jun 15, 2010 2:10 am
Location: Bangalore

Re: how to separate alphabets and numeric values

Post by srinivas.nettalam »

To get only alphabetic values use this Convert(Convert('ABCD..Z','',Upcase(Col)),'',Col) and to get numeric values only replace the alphabets with numbers..
N.Srinivas
India.
Post Reply