Hello!
How to filter all non-alphanumeric charaters from a srting. (filter space,/,-,* etc).
Is there a option in oconv function for this? or any other transformation function available for this?
Input string:
'SY-002-1|SALINAS-E Boronda Rd/San'
Result:
'SY0021SALINASEBorondaRdSan'
Thank you
Filtering non alphanumeric charaters
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 385
- Joined: Wed Jun 16, 2004 12:43 pm
- Location: Virginia, USA
- Contact:
Hi
To get the non-alpha and non-numbers use the MCA and MCN function twice.
Oconv(Oconv('String','MC/N'),'MC/A')
Best of luck
Thanks
To get the non-alpha and non-numbers use the MCA and MCN function twice.
Oconv(Oconv('String','MC/N'),'MC/A')
Best of luck
Thanks
Regards
Siva
Listening to the Learned
"The most precious wealth is the wealth acquired by the ear Indeed, of all wealth that wealth is the crown." - Thirukural By Thiruvalluvar
Siva
Listening to the Learned
"The most precious wealth is the wealth acquired by the ear Indeed, of all wealth that wealth is the crown." - Thirukural By Thiruvalluvar
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
So, to keep all the alphanumerics, use that result and convert to "".
Code: Select all
Convert(Oconv(Oconv(MyString,'MC/N'),'MC/A'), "", MyString)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.