SAS Institute. The Power to Know

FOCUS AREAS

Output Delivery System

Beginning with Version 7 of SAS software, all procedures use the Output Delivery System to manage their output. You can now make changes to the format and appearance of your SAS output by using the features of the Output Delivery System (ODS). You can edit the presentation format of your procedure output, create SAS output data sets from output tables, select or exclude individual pieces of output, and render output in a variety of formats.

Source DF SS Mean Square F Value Pr > F
Drug 1 5.993 5.993 2.71 0.1281
Depleted 1 15.448 15.448 6.98 0.0229
Drug*Depleted 1 4.691 4.691 2.12 0.1734
Time 3 . . 24.03 0.0001
Time_Drug 3 . . 5.78 0.0175
Time_Depleted 3 . . 21.31 0.0002
Time_Drug_Depleted 3 . . 12.48 0.0015


Figure 1. HTML Output from the GLM Procedure

All SAS procedures produce output objects that the Output Delivery System delivers to various output destinations, according to your specifications or the default specifications for the procedure. The default destination is the SAS listing file.

All output objects (for example, a table of parameter estimates) consist of two component parts: the results calculated by a SAS procedure and the template, which contains rules on how the results should be formatted and displayed. When you invoke a SAS procedure, the procedure sends all output to the Output Delivery System. ODS then routes the output to all current output destinations. You define the form the output should take when you specify the output destination. Supported output destinations include:

Future versions of ODS will support Rich Text Format (RTF) for inclusion in Microsoft Word , Postscript, and PCL for high fidelity printers, and the ODS Output Document for modifying and replaying output without rerunning the procedure that created it. You can define multiple output destinations to be active at the same time so that a single procedure step can route output to multiple destinations. If you do not specify any ODS statements, ODS delivers output to the SAS listing just like in previous releases.

Each output object has an associated template that defines its presentation format. You can modify the presentation of the output by modifying the associated template or specifying a new one via the TEMPLATE procedure. You can also specify stylistic elements for output destinations, such as cell formats and headers, column ordering, colors, and fonts.

For more detail, download the paper ODS for Data Analysis: Output As-You-Like-It in Version 7 by Chris Olinger and Randy Tobias. For more technical information on the Output Delivery System, download the documentation Using the Output Delivery System or visit the Base SAS Research and Development site.


As an illustration of the usefulness of ODS, this example uses ODS to render the displayed output in HTML with a hyperlinked table of contents. The data are from Pothoff and Roy (1964) and consist of growth measurements for 11 girls and 16 boys at ages 8, 10, 12, and 14.

  data pr;
    input Person Gender $ y1 y2 y3 y4;
    y=y1; Age=8; output;
    y=y2; Age=10; output;
    y=y3; Age=12; output;
    y=y4; Age=14; output;
    drop y1-y4; 
    datalines;
  1 F 21.0 20.0 21.5 23.0
  2 M 21.0 21.5 24.0 25.5
  . . .  
  run;

The ODS HTML statement specifies three files. The required BODY= argument specifies the file to contain the output generated from the statements that follow. The CONTENTS= option specifies a file to contain the table of contents. The FRAME= option specifies a frame HTML file to reference the table of contents and the output. You open the FRAME= file in your web browser to view the table of contents and the generated output.

  ods html body=’mixed.html’ 
           contents=’mixedcontents.html’
           frame=’mixedframe.html’;

The MIXED procedure is invoked to fit the specified model. The resulting output is displayed in Figure 2.

  proc mixed data=pr method=ml covtest asycov;
    class Person Gender;
    model y=Gender Age Gender*Age / s;
    repeated / type=un subject=Person;
  run;
  quit;
  ods html close;
Solution for Fixed Effects
Effect gender Estimate Standard Error DF t Value Pr > |t|
Intercept   15.8423 0.9356 25 16.93 <.0001
gender F 1.5831 1.4658 25 1.08 0.2904
gender M 0 . . . .
age   0.8268 0.07911 25 10.45 <.0001
age*gender F -0.3504 0.1239 25 -2.83 0.0091
age*gender M 0 . . . .

Type 3 Tests of Fixed Effects
Effect Num DF Den DF F Value Pr > F
gender 1 25 1.17 0.2904
age 1 25 110.54 <.0001
age*gender 1 25 7.99 0.0091

Figure 2. HTML Output from the MIXED Procedure


Statistics and Operations Research