Hello, Thanks for this, this looks very advanced. I tried your solution, but it doesn't work and I can not fix it because I don't really understand it. After whole day of research and testing, I finally ended up somewhere (but there's still a long way to go at this pace). First of all I run proc contents to get the variable names: proc contents data=have1 noprint out=col_name (keep=name); run; I then run the following statement to put those vars in some kind of macro i guess? Proc sql;
select * into :vars_to_run from col_name;
quit; And finally i get to the stage where I could calculate proc freq for every var in the dataset %macro test;
%do i=1 %to %sysfunc(countw(&variables_to_run));
proc freq data=have1;
tables var_name / norow nocol nopercent nocum missing out=var_name;
weight measurevar;
%end;
run;
%mend;
%test;
var_name - system should automatically select all available variables in the dataset I just need to find a way of telling SAS to run this for every var in the dataset and output as a separate dataset with var_name as a table name. Thanks, J
... View more