Chapter Contents

Previous

Next
SAS/CONNECT User's Guide

Example 5. Compute Services: Output Delivery System


Purpose

ODS allows you to format and change the appearance of a procedure's output. The output is converted into objects that can be stored in HTML or in a SAS data set. The output can then be manipulated and viewed in many different ways.


Program

This example creates a SAS data set and a SAS data view on a remote host, which contain information about U.S. Presidents and generates ODS output from them. The first half of this example creates HTML from the SAS data set and view. The second half uses ODS to create a SAS data set from the SAS data view.

rsubmit;

   data presidnt; 
      length fname lname $8 party $1 lady1 $10;
      input fname lname party year_in lady1;
   datalines;
John Kennedy D 1961 Jackie
Lyndon Johnson D 1963 LadyBird
Richard Nixon R 1969 Pat
Gerald Ford R 1974 Betty
Jimmy Carter D 1977 Rosalynn
Ronald Reagan R 1981 Nancy
George Bush R 1989 Barbara
Bill Clinton D 1993 Hillary
   ;
   run;

   proc sql nocheck;
      create view democrat as 
      select fname,lname,party,lady1 
         from presidnt
         where party='D';
   quit;

endrsubmit;

   /* Use ODS to create HTML from the output */
ods html 
   file="rsub.html"
   contents="rsubc.html"
   frame="rsubf.html";

   /* Remote SQL PassThru to DATA step view */
proc sql nocheck;
   connect to remote (server=rmthost);
   select fname,lname,lady1 
      from connection to remote 
      (select * from democrat);
quit;

   /* mix remote-submitted SQL with local SQL */
rsubmit;
   proc print data=democrat; 
   run;
endrsubmit;

ods html close;

   /* Use ODS to create a SAS data set */
ods output output="rdata";

rsubmit;
   proc print data=democrat;
   run;
endrsubmit;

[IMAGE]


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.