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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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