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[i]=(mapd[i]=1);
pdp[i]=(pdp[i]=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.作者: Qiong 时间: 2010-11-11 15:59 标题: Re: 《求助》 关于array 的问题。 if max(of mapd1-mapd12)=1 then pd=1;
else if max(of pdp1-pdp12)=1 then pd=2;
else pd=0;
run;