Hi experts,
I have a challenge situation here. I would like to looking for a text with 'Health Center' in one of my variables. However, it comes with different formats and different places. I am curious, if there is a way to find them. Thanks!
For example,
1. Health Center
2. health center
3. Health center
4. Health State Center
5. State health center
6. Health Department Center
7. Department health center
I would assume you wanna match text that basically should have both words.
How about
where findw(test,'health',' ','i') and findw(test,'center',' ','i');
/*or making sure health precedes center*/
where findw(test,'center',' ','i')>findw(test,'health',' ','i');
Do you mean this?
data have;
input test $40.;
cards;
1. Health Center
2. health center
3. Health center
4. Health State Center
5. State health center
6. Health Department Center
7. Department health center
;
data want;
set have;
where findw(test,'health center',' ','i');
run;
No, I would like to find all the seven answers even though there are one word in-between 'Health Center' or in front of it.
I would assume you wanna match text that basically should have both words.
How about
where findw(test,'health',' ','i') and findw(test,'center',' ','i');
/*or making sure health precedes center*/
where findw(test,'center',' ','i')>findw(test,'health',' ','i');
Thanks, that's what I want!
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 lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.