libname hospital v6 "c:\temp\hospital"; proc contents data=hospital.year97; run; proc univariate data=hospital.year97 plot; where age < 110; var age; histogram; run; proc freq data=hospital.year97; tables age race sex; run; proc freq data=hospital.year97 order=freq ; tables princ_dx; run; data year97temp; set hospital.year97; if index(princ_dx,"V") >=1 then Vcode=1; if index(princ_dx,"V") = 0 then Vcode=0; if Vcode=0 then len_dx = length (princ_dx); if len_dx = 3 then num_dx = princ_dx*1.0; if len_dx = 4 then num_dx = princ_dx/10.0; if len_dx = 5 then num_dx = princ_dx/100.0; if sex = 0 then sex = " "; if 0<=age<5 then agegroup=1; if 5<=age<10 then agegroup=2; if 10<=age<20 then agegroup=3; if 20<=age<30 then agegroup=4; if 30<=age<40 then agegroup=5; if 40<=age<50 then agegroup=6; if 50<=age<60 then agegroup=7; if 60<=age<70 then agegroup=8; if 70<=age<80 then agegroup=9; if 80<=age<90 then agegroup=10; if 90<=age<100 then agegroup=11; if 100<=age<110 then agegroup=12; run; proc freq data=year97temp; tables num_dx; run; proc freq; tables agegroup; run; proc freq data=year97temp order=freq; where age=0 and vcode=0; tables princ_dx; run; proc freq order=freq; tables num_dx; run; proc freq; where num_dx between 250 and 251; tables num_dx; run; proc freq; tables vcode; run; proc freq order=freq; where vcode=0; tables princ_dx; run; data allegan; set year97temp; if midb_zip in ("49010","49070","49078","49080", "49311","49314","49323","49328", "49335","49344","49348","49406", "49416","49419","49530","49453"); run; proc freq data=allegan; tables agegroup; run; data hospital.allegan; set allegan; run;