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
I tried using prxmatch would it be easier to use index? I am looking for word text4, text 7, and text9.
Sometimes they are misspell for example tex4
The index works if its one and spelled correctly
Data test;
Set test;
Text_position( varaible,"text4");
Run;
This works great i need to add the additional text7 and text9
1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
Fuzzy matching words is hard. You’ll also make mistakes, so decide if it’s worth the effort first.

View solution in original post

4 REPLIES 4
ChrisNZ
Tourmaline | Level 20

INDEX is faster.

PRXMATCH is more flexible.

 

POS=prxmatch('/(TEXT?4|TEXT7|TEXT9)/',STRING);
Reeza
Super User
Fuzzy matching words is hard. You’ll also make mistakes, so decide if it’s worth the effort first.
Gil_
Quartz | Level 8
The output is 0 even though the words is there. What is ? In text4
ChrisNZ
Tourmaline | Level 20

The output is 0 even though the words is there. What is ? In text4

 

Make the search case insensitive?

Add i after the second slash in the regular expression.

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
  • 4 replies
  • 638 views
  • 1 like
  • 3 in conversation