01-03-2017 07:47 AM
I'm doing an excerise where I'm trying to create a list with names that "sounds alike" och with a different spellibg ("Smith" and "Smythe" or "AAron" and "Aron"). I only have 1 table to look through and tried a very simple excerise where I hard-coded a name on which the program will look at to find names that sounds like it (see below):
There are two names in that table that sounds like Munson (Munksson and Munkson) and therefor a list is created with only those names. However, I want a code that is applied on all the names in that table for a list to be created with those names, whether it's Munson and Munksson or Anderson and Andersson. I've tried to find an example online, but only seem to find examples where they use a soundex on two tables... Has anyone done this before? If so, can anyone help me out a little? =)
01-03-2017 09:13 AM
Also, check out the COMPLEV and COMPGED functions, as described in this blog post from a SAS Tech Support consultant.
If you have the data quality software from SAS, you can use Match Codes (DQMATCH) to determine which names are likely the same or similar.
01-03-2017 09:19 AM
If you are looking for names that sounds like a given name you can use next code:
%let myname = <any given name>;
proc sql; title "Names Sound Like &myname"; select name from table where name=*"&myname"; quit;
but, if you want to find all groups of name that have same sound-like in a table,
then assume the table contains N names, you will need compare N*(N-1)/2 couple names
and assign a flag if the couple sounds alike or not.
01-03-2017 09:50 AM
01-04-2017 01:31 AM
If you want all unique "sounds like" pairs, join the table to itself on the sound-like relation, and insert a where condition to eliminate duplicates and identical spellings
proc sql; select a.name,b.name from have as a inner join have as b on a.name =* b.name where a.name < b.name; quit;
Of course, the sounds-like relation only allow equality/non-equality. It doesn't all any notion of "distance" between a pair of names.