Hi,
I have a data table with many variables, and I want to do a proc ttest on these variables using a macro. Here is what I did:
1) First I did proc contents to extract the names of the variables and then putting them into a macro list:
proc contents data=mydata out=contents noprint;
run;
data contents;
set contents;
keep name;
run;
proc sql noprint;
select name
into :name separated by ' '
from contents;
quit;
and then I wrote a macro that will do a proc ttest for all the varibales that are in the macro list "name":
%macro means;
%do %while("&name" NE "");
proc ttest data=mydata ;
class developed;
var &name;
run;
%mend;
%means;
But the macro runs without stopping...
I therefore guess that the code has an error somewhere, but the intuition behind the code is that the macro should run for all the variables within the macro list "name" and stop when there are no more variables left.
Thanks!