2 min read

Where is SAS Output Anyway?

It is said in An Introduction to R, one of R official documents (Current Version: 2.15.1):

There is an important difference in philosophy between S (and hence R) and the other main statistical systems. In S a statistical analysis is normally done as a series of steps, with intermediate results being stored in objects. Thus whereas SAS and SPSS will give copious output from a regression or discriminant analysis, R will give minimal output and store the results in a fit object for subsequent interrogation by further R functions.

For SAS, it’s true, but not exactly the whole story. Actually all outputs generated by SAS procedures are stored in datasets besides the “copious output” in Output Window for further processing if needed. It is totally controllable like object in R. Take a regression example, You can use ODS Select statement to select what you want to be displayed in Output Window, and ODS Output statement to fetch the output datasets(test on SAS 9.3M1 in Windows 7):

ods select Anova ResidualPlot;
ods output Anova=Anova;

proc reg data=fitness;
   model Oxygen=Age Weight RunTime RunPulse RestPulse MaxPulse / selection=forward; 
run;
quit;

or, you can use ODS Exclude statement to just drop some outputs in Output Window:

ods exclude ResidualPlot;

proc reg data=fitness;
   model Oxygen=Age Weight RunTime RunPulse RestPulse MaxPulse / selection=forward; 
run;
quit;

To get a list all the ODS outputs like Anova, ResidualPlot, you can trigger on ODS Trace ON statement:

ods trace on;

proc reg data=fitness;
   model Oxygen=Age Weight RunTime RunPulse RestPulse MaxPulse
         / selection=forward; 
run;
quit;

ods trace off;

then you get a full list in Log Window like:

————-
Name:       NObs
Label:      Number of Observations
Template:   Stat.Reg.NObs
Path:       Reg.MODEL1.SelectionMethod.Oxygen.NObs
————-

Output Added:
————-
Name:       ANOVA
Label:      ANOVA
Template:   Stat.REG.ANOVA
Path:       Reg.MODEL1.SelectionMethod.Oxygen.Step1.ANOVA
————-

Output Added:
————-
Name:       SelParmEst
Label:      Parameter Estimates
Template:   Stat.REG.SelParmEst
Path:       Reg.MODEL1.SelectionMethod.Oxygen.Step1.SelParmEst
————-