Summary: This script converts a name into the soundex code used by the US census. The soundex is a coded surname (last name) index based on the way a surname sounds rather than the way it is spelled. Surnames that sound the same, but are spelled differently, like SMITH and SMYTH, have the same code and are filed together. The soundex coding system was developed so that you can find a surname even though it may have been recorded under various spellings.

Every soundex code consists of a letter and three numbers, such as W-252. The letter in the code is always the first letter of the surname. The remaining three numbers are assigned to the remaining letters of the surname as follows:

The letters A, E, I, O, U, H, W, and Y are ignored and not assigned a number. Zeroes are added at the end if necessary to produce a four-character code. Additional letters are disregarded.

Instructions: Simply tap out the surname name you wish to convert to Soundex code. The soundex will build on the stack. Script will stop accepting letters after the Soundex code has been satisfied. Script sets calculator mode to Base 36 to display first letter of code. Script returns to Base 10 on exit.