3 ways PROC DOCUMENT can make your life easier


PROC DOCUMENT makes your life easier by giving you the freedom from the pre-determined order in which SAS stores procedure output.  You can also label, manage, and search your output so that it is at your fingertips when you need it.

You can learn what a DOCUMENT does and get a walk-through of its capabilities by downloading the free PDF of the first chapter from PROC DOCUMENT by Example Using SAS. In the examples below, an ODS DOCUMENT is portrayed as a collection of nested folders that hold SAS procedure output.

As promised, here are three ways PROC DOCUMENT can make your life easier.

1. You can replay output in any order you want.

The first example extracts the variables list from PROC CONTENTS and prints it above a summary table from PROC MEANS. In the original analysis, these would have appeared on different pages with PROC UNIVARAIATE output between.

2. You can print output only of a specific type.

When your code is run with BY-groups, the tables you want may be scattered across several pages. No worries - the WHERE= option on the REPLAY statement will bring all your output together for you in one place. The code below prints out only QUANTILES tables for MSRP, deftly consolidating like output tables.

3. You can search based on your own labels

Some folders are labeled automatically, but you can apply your own labels to any folder with the SETLABEL statement (discussed in both Chapter 1 and Chapter 4 of the book).  You can even use these labels as a way of subsetting data based on your own organization’s needs.  The code in this example would print out the Reserves 2010 folder, followed by the Loss Ratio folder.

This is just a hint of what PROC DOCUMENT can do to help you show off the hard work you’ve done on all those SAS analysis. Now that you've seen what it can do, start using it, and read PROC DOCUMENT by Example Using SAS to get the most out of this incredibly useful but under-appreciated procedure. Electronic versions of the book are also now available through Amazon Kindle and Google Play.




About Author

Michael Tuchman

Senior statistician at Accolade

Michael Tuchman is a senior statistician at Accolade, Inc., a leading provider of Professional Health Assistant services. A SAS user since 1999, Tuchman applies his extensive knowledge of SAS to understanding how customers utilize healthcare, ultimately empowering them to get more value out of the healthcare system. He is the author of PROC DOCUMENT by Example Using SAS.

Leave A Reply

Back to Top