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
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.
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
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.