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


 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 3480 views
  • 3 likes
  • 4 in conversation