The SOUNDEX2 routine is used to match two strings using an improved Soundex algorithm.
Note: All SOUNDEX related routines are limited to working with attribute sizes of 256
characters. If the attribute length exceeds 256 characters, the algorithm will be applied
to the first 256 characters for all SOUNDEX routines. The algorithm will be applied to the
last non-blank 256 characters for all RSOUNDEX routines.
Algorithm
- Replace all non-leading vowels with A.
- Transform the following prefixes in this order:
From characters To characters MAC
MCC
SCH
SSS
KN
NN
PF or PH
FF
K
C
- Transform these character combinations that occur after the first position in this
order:
From characters To characters CAAN TAAN NST NSS SCH SSS DG GG AV AF AW A KN NN PH FF D T Q G Z S M N K C - Replace H with A, unless it is preceded and followed by A (for example, AHA).
- Remove all A characters except for the leading A.
- Remove all but the first of repeating adjacent character substrings.
- (For Relationship Linker) The comparison is limited to the first four characters
returned for each field used in the Soundex2 routine.
Table 1. Scoring for SOUNDEX2 Score
Description 0
Case 1: Both strings are blank
Case 2: Neither string is blank and they are not equal.
50
One string is blank; the other string is non-blank.
100
Strings are equal.