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!
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: