I am encountering the error "More positional parameters found than defined" for the following code:
%let my_list_of_vars = x, y, z;
%macro sumstats(my_vars);
proc sql;
create table test2 as
select distinct &my_vars.
from my_dataset;
quit;
%mend sumstats;
%sumstats(&my_list_of_vars.);
I'm not quite sure why the proc sql isn't taking in my list of variables "x", "y", and "z", and is instead returning that error. I've looked online and cannot seem to find solutions to this issue. For instance, this website (http://support.sas.com/kb/31/012.html) suggests using %put or %bquote, but neither work. Would much appreciate some guidance.
Thank you.