Dear Experts,
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
Only have what ?
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.
data have ;
input have $ 20.;
cards;
abc&def%ghi
abc*def^ghi
;
data want;
set have;
want = compress(have,,'kp');
run;
proc print; run;
Output :
1 | abc&def%ghi | &% |
---|---|---|
2 | abc*def^ghi | *^ |
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.
Find more tutorials on the SAS Users YouTube channel.