Hello,
If I run the following code:
ODS SELECT GLM.ANOVA.AA.DiagnosticsPanel;
PROC GLM DATA = mydata1 PLOT = DIAGNOSTICS; CLASS A B; MODEL AA = A | B / SS3; OUTPUT OUT = res1 RESIDUAL = res1; RUN;
I can see the normal Fit Diagnostic plots. But if I run several commands:
ODS SELECT GLM.ANOVA.AA.DiagnosticsPanel;
PROC GLM DATA = mydata1 PLOT = DIAGNOSTICS; CLASS A B; MODEL AA = A | B / SS3; OUTPUT OUT = res1 RESIDUAL = res1; RUN;
ODS SELECT GLM.ANOVA.BB.DiagnosticsPanel;
PROC GLM DATA = mydata2 PLOT = DIAGNOSTICS; CLASS A B; MODEL BB = A | B / SS3; OUTPUT OUT = res2 RESIDUAL = res2; RUN;
There are warnings in the Log window:
WARNING:
Output 'GLM.ANOVA.BB.DiagnosticsPanel' 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.
In the Results window I can see normal Fit Diagnostic plots for AA, but for BB --- complete PROC GLM output (including diagnostics).
What's the reason ?
Always put the ODS statements after the proc statement (even though they often work before). Always end interactive procedures like glm and reg with a quit statement not a run statement.
Always put the ODS statements after the proc statement (even though they often work before). Always end interactive procedures like glm and reg with a quit statement not a run statement.
HI,
Since PROC GLM is one of the procedures that CAN be run interactively, my guess is that you would be better off ending each step with
RUN:
QUIT;
which should force each separate step to end by providing a "hard" step boundary. Frequently with ODS and procedures that support RUN group processing, if you want your desired output to be produced, you need to make sure you end the procedure BEFORE the destination closes. So typically, it would be something like this:
ods dest file='xxx.yyy';
ods select ???;
proc 1;
run;
quit;
ods select ???;
proc 2;
run;
quit;
ods dest close;
Cynthia
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.