BookmarkSubscribeRSS Feed
cdubs
Quartz | Level 8

I have a column called "name" where people manually inputted a lot of people's names. 

 

I am hoping to use SAS to look for duplicates, but there's a high chance there's high error rates, e.g. a few typos but a "normal human" would know that the two names are likely referring to the same person. 

 

I was wondering what it might look like if I asked SAS to first sort names in alphabetical order, then for each entry, compare the string directly and below it -- if either of those entries has the same amount of characters +/- 2, and then the same letters but with 4 differences, then we will count that as a duplicate and then the new var duplicate = 1. 

 

Not sure if people have ideas as to how I might compare strings this way? 

 

Thank you! 

3 REPLIES 3
Patrick
Opal | Level 21

@cdubs

Similar questions like yours come up from time to time. Have you already searched this forum with terms like "fuzzy match"?

You would find discussions like: https://communities.sas.com/t5/Base-SAS-Programming/Fuzzy-match-with-soundex-and-compged/m-p/295334/...

cdubs
Quartz | Level 8

I haven't! I'll look at those now 🙂 

PeterClemmensen
Tourmaline | Level 20

Have a look at the COMPGED and COMPLEV functions are good places to start.

sas-innovate-2024.png

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.

 

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