BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Gil_
Quartz | Level 8
Im needing help to find 3 words in a text
Here is what i have
Data test;
Set test;
If prxmatch('m/brake|brakepads| pads /oi',textbox,>0;
Run;
When i run it the data gets removed
1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

Start with fixing the syntax. You didn't close the parenthesis.

 

In regular expressions, always put substrings alternatives after the full string "m/brakepads|brake pads|pads|brake/io", that way you will match the full expression before any of its components.

 


@Gil_ wrote:
Im needing help to find 3 words in a text
Here is what i have
Data test;
Set test;
If prxmatch('m/brake|brakepads| pads /oi',textbox,>0;
Run;
When i run it the data gets removed

 

PG

View solution in original post

2 REPLIES 2
SuryaKiran
Meteorite | Level 14

What is it you want to do when you found those words in the string?

Since you are using an IF conditions only the records that contains those words are returned. SAS won't do anything that you haven't told to do so.

Thanks,
Suryakiran
PGStats
Opal | Level 21

Start with fixing the syntax. You didn't close the parenthesis.

 

In regular expressions, always put substrings alternatives after the full string "m/brakepads|brake pads|pads|brake/io", that way you will match the full expression before any of its components.

 


@Gil_ wrote:
Im needing help to find 3 words in a text
Here is what i have
Data test;
Set test;
If prxmatch('m/brake|brakepads| pads /oi',textbox,>0;
Run;
When i run it the data gets removed

 

PG

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1887 views
  • 0 likes
  • 3 in conversation