BookmarkSubscribeRSS Feed
docctong
Fluorite | Level 6

I need to do a word search on a text field.  While I know how to search for multiple words using the Prxmatch function, I am not sure how I can search words such as "fire suppression", "Young men", and etc, i.e., a simple phrase that has two words or more.  If I were to split the phrase into two separate words, like "fire" and "suppression", then I will get many wrong matches due to the word "fire".  The same is true for the words "Young" or "men".  Is there a way to combine these words and use it in the Prxmatch function?

 

Thanks.

2 REPLIES 2
art297
Opal | Level 21

A nice example can be found at: https://support.google.com/a/answer/1371417?hl=en#Match-Word-or-Phrase-in-a-List

 

Art, CEO, AnalystFinder.com

 

Patrick
Opal | Level 21

@docctong

With RegEx you're not really searching for words but for strings/text patterns. A blank between two words is nothing else than another character so simply search for such strings, i.e. '/fire suppression|young men/i'

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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
  • 2306 views
  • 0 likes
  • 3 in conversation