Ok I added a bit. %MACRO ICF(vars_icf=, vars_cor=, input=, output=);
%LET M=%WORDS(&vars_icf.);
%DO i=1 %TO &M.;
%Let var1 = %scan (&vars_icf., &i.);
%Let var2 = %scan(&vars_cor., &i.);
ODS Output summary=output1 (RENAME=(&var1._N = N &var1._NMISS = NMiss));
proc means data=&input. N NMISS;
var &var1.;
run;
ods output close;
data output 1_1;
set output1;
format variablenname $20.;
variablenname = "&vars_icf.";
run;
ods output summary=output2;
proc freq data=&input.;
tables &var1. / NOCUM;
run;
ods output close;
set output1;
ods output summary=test2;
proc corr data=&input. PEARSON NOMISS NOPROB NOSIMPLE;
var &var1.;
with &vars_cor.;
ods output close;
data output3_1;
set test2;
%END;
%MEND icf;
%icf(input=multiple_sclerosis, vars_cor=eq5d, vars_icf=d530); I want to do the following with this macro: The vars_icf all can be between 0 and 4. So each row stands for 1 variable (d530, d540...) and in the columns, for each var I want N, NMiss, the absolute and relative frequency and the correlations with the variables of vars_cor.
... View more