12-04-2016 01:56 AM
%if &set1=1 %then %do;
proc freq data=dataset;
proc means data=sasdata.dataset ;
I want to get the macro for each of the variables i.e week and accessories
I should be able to get either freq or means report for above-mentioned variables.My code is below .
But seems i am missing something.can anybody advise?
12-04-2016 02:15 AM
Your original macro won't work, because you use &table1 as a dataset in one place and a variable list in another.
Hint: get your steps working without macro code, then replace the future dynamic parts with macro variables, then wrap into a macro definition, and then add macro logic (%if). Test at every step of the development, and thoroughly look at the log. Do a google search for each log message you do not understand.
If you run into obstacles you can't overcome, post test data (data step with datalines) and the log.
12-04-2016 02:00 PM
These papers outline the basic process of starting with working code and then converting your code to a Macro program: