Thanks Reeza for the direction, the ucla link does actually have prety much the same thing and I got my wanted result!
But just one thing that I would like to note. Here is my code :
%let data_list = boston new_york
%macro means_for_all(all_data);
%let k=1;
%let the_data= %scan(&all_data, &k);
%do %while("&the_data" NE "");
title "data table is &the_data";
proc means data=&the_data n min max mean;
var _all_;
run;
%let k = %eval(&k + 1);
%let the_data = %scan(&all_data, &k);
%end;
%mend;
%means_for_all(&data_list)
First I put the names of the tables into a macro variable "&data_list". Then when I run the macro the way above, i.e I put "&data_list" inside the parantheses, I get error messages such as work.data.mean doesn't exist, so for some reason sas treats the proc means options as if they were data names, BUT the result is the same as if when calling the macro I had inputted the variable names one by one, strange...
... View more