Hi All,
I'm trying to right a program which will sum up all the unique words in a variable - this needs to be not case sensitive. I need to use just Base SAS.
So the output I'm looking for is something like this (this is not the full list):
Is there a way to write a do loop? It would obviously way too difficult to you just string functions to do this.
Any assistance is greatly appreciated.
Thanks!
A few functions - countw, compress, scan, and lowcase can get you pretty far.
data words;
set have;
num_words=countw(sentence);
do i=1 to num_words;
word=lowcase(compress(scan(sentence, i), , 'ka'));
output;
end;
keep word;
run;
proc freq data=words;
table word;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.Register now and save with the early bird rate—just $795!
Register now
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.
Browse our catalog!