data tryarray ;
set cau2006.rica(keep=baseid H_pdtp01-H_pdtp12 H_GHPSW);
array mapd[12] H_PDTP01-H_PDTP12;
array pdp[12] H_PDTP01-H_PDTP12;
do i=1 to 12;
mapd=(mapd=1);
pdp=(pdp=2);
end;
if max(of mapd1-mapd12)=1 then pd=1;
else if max(of pdp1-pdp12)=1 then pd=2;
else pd=0;
run;
proc freq data=tryarray;
table pd*h_ghpsw;
run;
the problem is
NOTE: Variable mapd1 is uninitialized till mapd12 is uninitialized. the same as the variable pdp
NOTE: Variable pdp1 is uninitialized. till pdp12 is uninitialized.
I think the problem is in the loop part. but I don't know how to solve it.
谢谢帮忙先。