HI All,
I have base SAS, E.G., SAS Studio, and
Need to search a large document for all acronyms (2, 3, 4 character), isolate them, and create a table of definitions.
The acronyms can be any character like "IND", "mg", 'USP", etc...
Is there a SAS function , or combination of functions, that will count the number of characters in a word, and provide a YES/NO (1/0) answer if a certain number of characters are present?
Thanks
It's easy to count the number of characters in a word:
n_characters = lengthn(varname);
I'm not sure you gain anything by translating this into a YES/NO. You can easily select a subset that you want:
if n_characters = 3;
or
if 0 < n_characters < 3;
or anything else that you would select. Possibly:
proc freq data=have;
tables varname;
where (0 < lengthn(varname) < 3);
run;
It's easy to count the number of characters in a word:
n_characters = lengthn(varname);
I'm not sure you gain anything by translating this into a YES/NO. You can easily select a subset that you want:
if n_characters = 3;
or
if 0 < n_characters < 3;
or anything else that you would select. Possibly:
proc freq data=have;
tables varname;
where (0 < lengthn(varname) < 3);
run;
This works like a charm, Very intersting, Thanks!
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.