07-11-2015 12:16 AM
Regret for posting this question in articles section. I tried to post it in discussions and every time i click post message i get a message that "Not allowed to post content more than once every 120 seconds". I waited for a day hoping that this issue will be resolved, but its the same. So i had no option when i tried to post it here it worked.
This is with regard to a scenario where i would like to output special characters alone from the string.
consider that we have the following data
"james ,thom,son & eligbeth ' samm"
the output should have only
07-11-2015 09:02 PM
Take a look at the COMPRESS function, especially the third parameter. That controls what characters you would like to remove from an existing string, so you will be left with only the special characters. It's up to you what "special" means, so look at the details of what is possible in that third parameter.
07-13-2015 04:22 AM
data have ;
input have $ 20.;
want = compress(have,,'kp');
proc print; run;