c**********e 发帖数: 2007 | 1 Suppose one of the inputs is a macro variable. The macro variable is a list
of variable name separated by space.
For example, in the macro, the list of predictors is the input:
%macro regression(ind_var);
proc reg data=mydata;
model y = &ind_var.;
run;
%mend;
A call of the macro takes the following form:
%regression(x1 x2 x3 w1 w2);
My question is how to get the number of predictors. In the above macro call,
I want to get the number 5, which is the number of independent variables.
How to do it?
Thansk a ton! | D******n 发帖数: 2836 | 2 %sysfunc(countw(&ind_var))
list
【在 c**********e 的大作中提到】 : Suppose one of the inputs is a macro variable. The macro variable is a list : of variable name separated by space. : For example, in the macro, the list of predictors is the input: : %macro regression(ind_var); : proc reg data=mydata; : model y = &ind_var.; : run; : %mend; : A call of the macro takes the following form: : %regression(x1 x2 x3 w1 w2);
|
|