Online File
Rick Aster: Professional SAS Programming Shortcuts: Contents
data _null_; length addresstext wordtext addressstd $ 48; addresstext = '1448 East Mill Avenue'; array word{9} $ 20; wordtext = translate(upcase(addresstext), ' ', "!(),/:?"); do i = 1 to dim(word); word{i} = scan(wordtext, i, ' '); from = word{i}; if from = '' then leave; * Substitute word from thesaurus. ; set main.adthes key=from/unique; if _iorc_ then do; * Not found. ; _iorc_ = 0; _error_ = 0; end; else word{i} = to; if i = 1 then addressstd = word{i}; else addressstd = trim(addressstd) || ' ' || word{i}; end; put (addresstext wordtext addressstd) ($char48. /); stop; run;