Tips:I want to hear the sound of SOUNDEX

From sasCommunity

Jump to: navigation, search

Phonetic algorithms can be useful in situation where the names are spelled differently by the same person. In this situation, it is critical that phonetic algorithms are used for de-duplication purposes.Soundex Wiki

/*EXAMPLE OF SOUNDEX PHONETIC APPLICATION*/
 
DATA _NULL_;
 
/*A CASE WHERE THE NAME IS THE SAME BUT SPELT DIFFERENTLY*/
 
NAME1 = "IAN";
NAME2 = "IAIN";
 
/*A DIRECT STRING COMPARISON IN THIS CASE WILL FAIL*/
 
IF NAME1 = NAME2 THEN PUT "NAME1 = NAME2 IS TRUE.";
ELSE PUT "NAME1 = NAME2 IS FALSE.";
 
/*A SOUNDEX STRING COMPARISON IN THIS CASE WILL SUCCEED*/
 
IF SOUNDEX(NAME1) = SOUNDEX(NAME2) THEN PUT "NAME1 = NAME2 IS TRUE.";
ELSE PUT "NAME1 = NAME2 IS FALSE.";
 
RUN;

Submitted by Murphy Choy. Contact me at my Discussion Page.