I am looking to create a macro in SAS which will calculate the mean for an arbitrary number of numeric variables (variables are the parameter and are input by the user) from a data set. I only know how to input the variables one by one and am unsure on how to set it so any number of variables can be input when invoking the macro, thanks.
Right now I have the code
%macro meanStat/parmbuff;
%put Syspbuff contains: &syspbuff;
proc means data = sashelp.baseball mean;
var &syspbuff;
%mend meanStat;
%meanStat(hits, runs)`
And with this I get the error:
ERROR 22-322: Syntax error, expecting one of the following: a name, ;, /, ALL, CHARACTER, CHAR, NUMERIC.
I'm supposed to use "parmbuff" as well
proc summary
? Perhaps it would be easier to help you if you provided a dummy example of what your input and expected output look like. – Therkelarray
. – Therkel