Online File

How to use this page


Rick Aster: Professional SAS Programming Shortcuts: Contents

Chapter 81
Program
Standardized addresses (thesaurus)


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;

 O /\

Global
Statements

RICK ASTER

SAS

BOOKS

Tech | Dictionary

Download | Rastinate

Rick Aster

Professional SAS Programming Shortcuts

Contents/Online Files

Corrections

Catalog Page