Hi all,
I am trying to print all of the tables in one rtf file. However with below macro it is printing only the last one. I don't know what I am doing wrong. Could you give me any ideas/suggestion?
Thanks
%macro score(d);
data sc_inc_sdf_&d.;
set sdf.inc_sdf_&d.;
Test_score=input(TestRawScore,32.);
run;
Proc Freq data= sc_inc_sdf_&d.;
Table Test_score /Missing out=freq_&d.;
RUN;
data freq_&d.;
set freq_&d.;
Cum_Count+Count;
Cum_Percent+Percent;
RUN;
Proc Sql;
Create table score.score_dist_&d. as
Select Test_Score, Count format=comma10. Label="Count", Percent format=comma8.2 label ="Percent", Cum_Count format=comma10. Label="Cumulative Count",
Cum_Percent format=comma8.2 label ="Cumulative Percent"
From freq_&d.;
QUIT;
ods rtf file='C:\Score\Score Distribution Tables.rtf' style = Minimal;
title "Score Distribution &d.";
proc print data=score_dist_&d. noobs label;
RUN;
%mend score;
%score(ela_1);
%score(ela_2);
%score(ela_3);
%score(ela_4);
%score(ela_5);
%score(ela_6);
%score(ela_7);
%score(MAT_1);
%score(MAT_2);
%score(MAT_3);
%score(MAT_4);
%score(MAT_5);
%score(ALG_1);
%score(ALG_2);
%score(GEO_1);
Edit: subject changed by @Kurt_Bremser
... View more