Extract Numberics & Chars only from a string
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 353
- Joined: Wed Apr 06, 2005 8:45 am
Extract Numberics & Chars only from a string
Hi,
Is there a function or way to extract only numbers and characters from a string. I need to do this so to avoid special characters and line termination characters.
Thanks,
Is there a function or way to extract only numbers and characters from a string. I need to do this so to avoid special characters and line termination characters.
Thanks,
-
- Charter Member
- Posts: 199
- Joined: Tue Jan 18, 2005 2:50 am
- Location: India
to get only numeric value from a string : oconv(string,"MCN")
to get only alphabetic value: oconv(string,"MCA")
to get numeric+special character value from a string : oconv(string,"MC/A")
to get only alphabetic+special character value: oconv(string,"MC/N")
You look for "Masked Character Conversions" in the Datastage help documents, you will get to know more.
to get only alphabetic value: oconv(string,"MCA")
to get numeric+special character value from a string : oconv(string,"MC/A")
to get only alphabetic+special character value: oconv(string,"MC/N")
You look for "Masked Character Conversions" in the Datastage help documents, you will get to know more.
Shantanu Choudhary
-
- Premium Member
- Posts: 353
- Joined: Wed Apr 06, 2005 8:45 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 353
- Joined: Wed Apr 06, 2005 8:45 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 353
- Joined: Wed Apr 06, 2005 8:45 am
Hi,
For some strange reason I can't help feeling like the problem might be something like reading a windows source file that still has CRLF line termination instead of LF only as in unix.
if that is the case you can use the CRLF style on the sequential file or make sure when it is transfered to you it converts the Line termination style between different platforms.
if you do this then you won't have a problem.
so I ask does my 6th scense work?
IHTH,
For some strange reason I can't help feeling like the problem might be something like reading a windows source file that still has CRLF line termination instead of LF only as in unix.
if that is the case you can use the CRLF style on the sequential file or make sure when it is transfered to you it converts the Line termination style between different platforms.
if you do this then you won't have a problem.
so I ask does my 6th scense work?
IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
![Image](http://www.worldcommunitygrid.org/images/logo.gif)
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
![Image](http://www.worldcommunitygrid.org/images/logo.gif)
-
- Premium Member
- Posts: 353
- Joined: Wed Apr 06, 2005 8:45 am