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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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