We’re smarter together. Learn from this collection of community knowledge and add your expertise.

Okay ODS, just give me what I want!

by SAS Employee ets_kps on ‎11-17-2014 01:45 PM - edited on ‎10-06-2015 03:12 PM by Community Manager (1,290 Views)

One of the most powerful but most misunderstood (and occasionally frustrating) features of coding in SAS is the ODS system. ODS, which stands for Output Delivery System, is the way that the SAS system allows users to render output in the form of graphs and tables. It is very powerful but often confusing, especially to those coming to SAS from other statistical computing languages. Here are two tips that I have learned in the past few years that might help you leverage the power of ODS. It has to do with which output is rendered. I found myself asking the question….




This is a natural question for those coming from other programming languages. Whether it is R, Stata or Matlab, the amount of information SAS provides to the user after a statistical model is impressive. Sometimes, it is also cumbersome. So how can you limit output?

First, let’s make sure you have the ODS system on which you can ensure by entering,

ods graphics on;


at the beginning of your sas program.


From here let’s try to run a simple regression using the familiar  REG procedure. Here is the output.




Gosh that is a lot of information!


What if I really just want to look at the fit statistics or perhaps just the coefficient table? How do I do this?

The easy way is with creative use of the “ods select” statements within the PROC call. Here is an example of how to just ask for the coefficient table.single_table.png

Or perhaps I just want to see the parameter estimates and the residual plots. Notice I need to make two changes to the syntax. First I must ask for the plot to be produced (plots=residualplot) as well as I need to add that item to the ods select statement. Here is the result.



So where can I find the name of these tables and graphics? Each table and graph in each PROC has a name. For a list of all the names you can go to the “Details” section for the documentation for each procedure. There are separate sections for “ODS Table Names” and “ODS Graphics”.  Here are the sections for the AUTOREG procedure (Tables, Graphics).




What if you want to save a specific ODS table to a data set? The “ODS OUTPUT” option allows for this. For example, if we want to save the above parameter estimates table as a sas dataset, you can add the “ODS OUTPUT PARAMETERESTIMATES=WORK.PARMS;” option to the PROC REG call. In this case, the file is saved in the WORK directory, but you can save it wherever you like.




These were just my suggestions. Do you have some of your own? Do you like using the ODS TRACE options?

Please share those in the comment section below so we all can become comfortable working with the powerful ODS options available to you.

by Contributor Peter_L
on ‎11-26-2014 06:32 AM

I have used ODS TRACE. I prefer to have the information in the documentation: it is known to the PROC writers so they can tell us. If you use trace, you have to run the code an extra time just to discover what is already known. I view tracing as a debugging tool.

by SAS Employee CommAdmin
on ‎11-26-2014 10:24 AM

Hi ets_kps - I moved your document to the ODS and Base Reporting community- just wanted to let you know. Thanks for the great article

by Learner JohnKP
on ‎09-29-2016 05:33 PM

I want to be able to view ONLY the residual plots in my output using ods.


I am using proc glimmix, and created residual plots to check assumptions for a large data set. So I have 3 residual plots (original, log10, and ln) for each data point and I just want to streamline the comparison of plots between the 3.  I have tried using ods but can't seem to get the syntax just right.


 Any suggestions, please?


proc glimmix data=a plots=residualpanel ;
class blk cover tillage;
model y=cover|tillage/ddfm=satterth;
random blk blk*cover blk*cover*tillage;
lsmeans cover/ lines pdiff;
lsmeans tillage/ lines pdiff;
lsmeans cover*tillage/lines pdiff;


by Community Manager
on ‎09-29-2016 05:39 PM

 Hi @JohnKP, thanks for joining the communities and posting in here. Your best bet for a quick answer would be to post your question on the ODS and Base Reporting Community: https://communities.sas.com/t5/ODS-and-Base-Reporting/bd-p/ods_base_reporting More experts will see it there than in this old comment thread.

Your turn
Sign In!

Want to write an article? Sign in with your profile.