Output Delivery System (ODS)

The Output Delivery System (ODS for short) can route the contents of any printed output to a variety of sources, including:

HTML Example:

 * ODS_html.sas: Example outputing procedure table to html. *;

  libname lhsas "~larryh/sasnotes";
  libname library "~larryh/sasnotes";

  ods html body="freqBody.html"
           contents="freqCont.html"
           frame="freqFrame.html";

  proc freq data=lhsas.gss04;
    tables sex race wrkstat degree;
  run;

  ods html close;

This produces three html output files which create an tml document with frames.

<70>% ls -l *.html
-rw-------   1 larryh   1864       24845 Jan 30 13:44 freqBody.html
-rw-------   1 larryh   1864       25486 Jan 30 13:44 freqCont.html
-rw-------   1 larryh   1864         742 Jan 30 13:44 freqFrame.html
<71>%

You can view them with a browser running on strauss. Use the netscape-launcher command. However, netscape-launcher is not located in a directory included in the standard search path, so you must type the complete pathname of the command --

/usr/lib/netscape-launcher freqFrame.html

(You can modify your path so netscape-launcher can be located without need to type the whole path -- ask me if you want to do it.) The browser takes a long time to load, but once it is started you can reload it quickly. Sometimes the browser on strauss is a little "flakey." You can download the files to Windows and double-click on the frame to view them as a set.

The file named freqFrame.html is the main file for the frameset. It references the other two files (freqCont.html (left frame -- contents) and freqBody (right frame -- body of the table produced by proc freq). Note the ODS syntax which produces these.

RTF Example:

 * ODS_rtf.sas: Example outputing procedure table to rtf. *;

  libname lhsas "~larryh/sasnotes";
  libname library "~larryh/sasnotes";

  ods rtf file="frequencies.rtf";

  proc freq data=lhsas.gss04;
    tables sex race wrkstat degree;
  run;

  ods rtf close;

This produces one rtf file named frequencies.rtf which can be downloaded and viewed and/or edited with Word.

PDF Example:

 * ODS_pdf.sas: Example outputing procedure table to pdf. *;

  libname lhsas "~larryh/sasnotes";
  libname library "~larryh/sasnotes";

  ods pdf file="frequencies.pdf" color=full;

  proc freq data=lhsas.gss04;
    tables sex race wrkstat degree;
  run;

  ods pdf close;

This produces one pdf file named frequencies.pdf which can be downloaded and viewed with Acrobat Reader or viewd on strauss with --

  acroread frequencies.pdf &

Compound Example -- Output to SAS Dataset & to RTF

This example combines output to a SAS data set, merging outputs from 3 regressions to build a compound table that is output to an RTF file. Note that the final table can be output to other destinations such as an html file with very minor changes.

The output table is close to a production table that might be submitted in a thesis, dissertation or journal paper. It can be downloaded and edited to clean it up with Word for presentation. Similarly, html output could be edited, for example, to move the system of asterisks to the left of the table cells and specify them as superscripts.