Chapter Contents |
Previous |
Next |
SOUNDEX |
Category: | Character |
Syntax | |
Arguments | |
Details | |
Examples |
Syntax |
SOUNDEX(argument) |
Details |
The SOUNDEX function encodes a character string according to an algorithm originally developed by Margaret K. Odell and Robert C. Russel (US Patents 1261167 (1918) and 1435663 (1922)). The algorithm is described in Knuth, The Art of Computer Programming, Volume 3 (See References).
The SOUNDEX function returns a copy of the argument encoded by using the following steps.
A E H I O U W Y
1: B F P V | |
2: C G J K Q S X Z | |
3: D T | |
4: L | |
5: M N | |
6: R |
The algorithm described in Knuth adds trailing zeroes and truncates the result to the length of 4. You can perform these operations with other SAS functions.
Examples |
SAS Statements | Results |
---|---|
x=soundex('Paul'); put x; |
P4 |
word='amnesty'; x=soundex(word); put x; |
A523 |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.