Online File

How to use this page


Rick Aster: Professional SAS Programming Shortcuts: Contents

Chapter 53
Program
State capital hash lookup


data work.outer (drop=rc);
   length state $ 2 capital $ 20;
   if _n_ = 1 then do;
      declare hash statecapital(dataset: 'main.capitals', ordered: 'a');
      statecapital.definekey('state');
      statecapital.definedata('state', 'capital');
      statecapital.definedone();
      end;
   set work.locate;
   rc = statecapital.find();
   if rc then do;
      capital = '';
      end;
   if capital ne city;
run;

 O /\

Global
Statements

RICK ASTER

SAS

BOOKS

Tech | Dictionary

Download | Rastinate

Rick Aster

Professional SAS Programming Shortcuts

Contents/Online Files

Corrections

Catalog Page