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.
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:
standard SAS listing or output window
hypertext markup language (HTML)
output SAS data set
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;
Figure 2. HTML Output from the MIXED Procedure |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||