/**************************************** This command file illustrates some arrays. filename: exercise2.sas *****************************************/ OPTIONS FORMCHAR="|----|+|---+=|-/\<>*"; title; libname sasdata2 "e:\sasdata2"; data sasdata2.tecumseh2; set sasdata2.tecumseh; array weight(3) wtkg1 wtkg2 wtkg3; array lweight(3) logwt1 logwt2 logwt3; do i=1 to 3; lweight(i) = log(weight(i)); end; array sbp(3) sbp1 sbp2 sbp3; array dbp(3) dbp1 dbp2 dbp3; array hyperten(3) hyperten1 hyperten2 hyperten3; do i=1 to 3; if sbp(i) > 140 or dbp(i) > 90 then hyperten(i)=1; else if sbp(i)=. or dbp(i)=. then hyperten(i)=.; else hyperten(i)=0; end; drop i; run; proc means data=sasdata2.tecumseh2; run; proc freq data=sasdata2.tecumseh2; tables hyperten1 hyperten2 hyperten3; run;