Monday, July 6, 2009

SAS: Grid Table

data test;
keep a1-a1260 Weight;
set sri.target_home;
a1=qc6_Bath_JCpenney_1;
a2=qc6_Bath_JCpenney_2;
a3=qc6_Bath_JCpenney_3;
a4=qc6_Bath_JCpenney_4;
a5=qc6_Bath_JCpenney_5;
a6=qc6_Bath_JCpenney_6;
a7=qc6_Bath_JCpenney_7;
a8=qc6_Bath_JCpenney_8;
a9=qc6_Bath_JCpenney_9;
a10=qc6_Bath_JCpenney_10;
run;
%macro tet;
proc freq data=test;
%do i=1 %to 100;
table a&i./out=test_a&i.(rename=(a&i.=id count=a&i.) drop=percent);
%end;
WEIGHT Weight;
run;
data final;
merge
%do i=1 %to 100;
test_a&i.
%end;;
by id;
run;
%mend;
%tet;
proc transpose data=final out=t123;
run;

No comments:

Post a Comment