Hi, I have a dataset which is
ID Name
1 fact mobile
2 stay focus mobile
3 facial
4 free flow in the rest mobile
5 secured locate
6 focus in the center right angle mobile
I want to select all the ID's which has "mobile" word in the Name variable.
1 fact mobile
2 stay focus mobile
3 free flow in the rest mobile
4 focus in the center right angle mobile
thank you in advance.
data want; set have; where find(name,'mobile','i')>0; run;
If it must exactly match the word and not allow "mobile" as part of a compound word then use FINDW.
data want; set have; where find(name,'mobile','i')>0; run;
If it must exactly match the word and not allow "mobile" as part of a compound word then use FINDW.
where name contains 'mobile';
@yaakov555 wrote:
where name contains 'mobile';
This won't match, if name is "Super Mobile Provider".
@yaakov555 wrote:
where name contains 'mobile';
Did you try the code?:
Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.
Explore Now →SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.