Hello, I am trying to report the anova results from PROC GLM in a dataset using ODS. If I use only one variable (p_total_a, looking to see if it differs across 13 different ID groups), what I am trying to do works perfectly (code below): ods trace on / label; ods output modelanova=output; proc glm data=dataset; class id; model p_total_a = id; lsmeans id; run; ods output close; ods trace off; However, I have multiple variables that I need to do this for, so I tried to wrap the procedure in a Macro, but it only creates one output dataset instead of multiple (only for the first variable I run through the macro). If I check the log, after the first iteration of the macro with the first variable, I get a warning message that reads: WARNING: Output 'modelanova' was not created. Make sure that the output object name, label, or path is spelled correctly. Also, verify that the appropriate procedure options are used to produce the requested output object. For example, verify that the NOPRINT option is not used. WARNING: The current ODS SELECT/EXCLUDE/OUTPUT statement was cleared because the end of a procedure step was detected. Probable causes for this include the non-termination of an interactive procedure (type quit; to end the procedure) and a run group with no output. Below is the code I am using for the macro. Any suggestions welcome. Thank you! ods trace on / label; %macro macro(var=); ods output modelanova=output_&var; proc glm data=dataset; class id; model &var = id; lsmeans id; run; ods output close; %mend macro; ods trace off; %macro(var=p_total_a) %macro(var=p_total_b)
... View more