BookmarkSubscribeRSS Feed
Fistful_Dollars
Obsidian | Level 7

I have a lookup table of manufacturer name.  I have a second table of misspelled manufacturer names.  How can I get the misspelled words corrected in a new, third table showing the before and after using SAS code?  My Data set has thousands of distinct misspelled words.

 

Lookup Table:

 

Samsung

Sony

Nokia

Dell

Apple

HP

 

Misspelled Names Table:

 

Samesung

Soni

Nokya

Doll

Apele

HC

4 REPLIES 4
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Well, you could use soundex:

http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000245948.htm

https://blogs.sas.com/content/sgf/2015/01/27/how-to-perform-a-fuzzy-match-using-sas-functions/

 

Problem is what happens if one of your mispelt ones is actually another name, or exactly between the two.  Its really a data capture issue, if a pre-defined list of companies was to be used then it should have been a select from dropdown rather than free text, free text is always an issue.

Fistful_Dollars
Obsidian | Level 7

Thanks, RW9.  The code from that blog page helped.  Not super accurate, but like you say that's the issue with free-form text and no drop-down.

ballardw
Super User

If it makes you feel any better I've had to clean up such. One project where had an expected list of company names to be common answers we provided the data collection people with what should be entered. I had 18 spellings for what should have been IBM. The most entertaining of which was I>B>M>

Reeza
Super User

You can check if your company has DataFlux. It's designed for exactly this type of matching. 

 


@Fistful_Dollars wrote:

I have a lookup table of manufacturer name.  I have a second table of misspelled manufacturer names.  How can I get the misspelled words corrected in a new, third table showing the before and after using SAS code?  My Data set has thousands of distinct misspelled words.

 

Lookup Table:

 

Samsung

Sony

Nokia

Dell

Apple

HP

 

Misspelled Names Table:

 

Samesung

Soni

Nokya

Doll

Apele

HC


 

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
  • 4 replies
  • 2302 views
  • 3 likes
  • 4 in conversation