klaz2002 (Programmer)
3 Jun 09 12:10
probably data steps.
Thank klaz2002
for this valuable post!
Inappropriate post?
If so, Red Flag it!
Check out the FAQ
area for this forum!
charisi (TechnicalUser)
7 Jun 09 20:45
i have a data set and would like to run macro and obtain summary statistics for three numeric variables var2,var3,var4 against one categoric variable(var5) using
the following either of this code:
%macro examq1f(id, var2, var3, var4, var5);
proc freq;
title 'frequency tables using macro';
tables &table var &id &var2 &var3&var4 &var5;
run;
proc means n mean std median Q1 Q3 max min;
var &var2 &var3 &var4;
run;
proc sort;
by &var5;
run;
%mend examq1f;
%examq1f;
%examq1f;
or alternatively%macro examq1f(tablevar)
proc freq;
title frequency tables using a macro';
tables &tablevar;
%mend examq1f;
%examqif(var5);
%examq1f(var5);
iam failing to get an output or print out when i run this code.
what am i doing wrong klaz?
how can i get an output or print out using this macro code or is this the wrong way of running / using macro to obtain the summary statistics? how can one use macro in this scenario?
i have also tried to run; code:
options mprint mlogic symbolgen:
and still can not get macro running or give me an out put even using pro print; run;
can you please help ?
3 Jun 09 12:10
probably data steps.
Thank klaz2002
for this valuable post!
Inappropriate post?
If so, Red Flag it!
Check out the FAQ
area for this forum!
charisi (TechnicalUser)
7 Jun 09 20:45
i have a data set and would like to run macro and obtain summary statistics for three numeric variables var2,var3,var4 against one categoric variable(var5) using
the following either of this code:
%macro examq1f(id, var2, var3, var4, var5);
proc freq;
title 'frequency tables using macro';
tables &table var &id &var2 &var3&var4 &var5;
run;
proc means n mean std median Q1 Q3 max min;
var &var2 &var3 &var4;
run;
proc sort;
by &var5;
run;
%mend examq1f;
%examq1f;
%examq1f;
or alternatively%macro examq1f(tablevar)
proc freq;
title frequency tables using a macro';
tables &tablevar;
%mend examq1f;
%examqif(var5);
%examq1f(var5);
iam failing to get an output or print out when i run this code.
what am i doing wrong klaz?
how can i get an output or print out using this macro code or is this the wrong way of running / using macro to obtain the summary statistics? how can one use macro in this scenario?
i have also tried to run; code:
options mprint mlogic symbolgen:
and still can not get macro running or give me an out put even using pro print; run;
can you please help ?