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.
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
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'
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.