BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Smitha9
Fluorite | Level 6

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.

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User
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.

View solution in original post

5 REPLIES 5
ballardw
Super User
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.

yaakov555
Fluorite | Level 6

where name contains 'mobile';

andreas_lds
Jade | Level 19

@yaakov555 wrote:

where name contains 'mobile';


This won't match, if name is "Super Mobile Provider".

ballardw
Super User

@yaakov555 wrote:

where name contains 'mobile';


Did you try the code?:

Smitha9
Fluorite | Level 6
yes it worked. thanks and I accepted as the solution.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

Mastering the WHERE Clause in PROC SQL

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.

Discussion stats
  • 5 replies
  • 802 views
  • 0 likes
  • 4 in conversation