Previous Page | Next Page

Programming with the SQL Procedure

Using the Output Delivery System with PROC SQL

The Output Delivery System (ODS) enables you to produce the output from PROC SQL in a variety of different formats such as PostScript, HTML, or list output. ODS defines the structure of the raw output from SAS procedures and from the SAS DATA step. The combination of data with a definition of its output structure is called an output object. Output objects can be sent to any of the various ODS destinations, which include listing, HTML, output, and printer. When new destinations are added to ODS, they automatically become available to PROC SQL, to all other SAS procedures that support ODS, and to the DATA step. For more information about ODS, see the SAS Output Delivery System: User's Guide.

The following example opens the HTML destination and specifies ODSOUT.HTM as the file that will contain the HTML output. The output from PROC SQL is sent to ODSOUT.HTM.

Note:   This example uses filenames that might not be valid in all operating environments. To run the example successfully in your operating environment, you might need to change the file specifications.   [cautionend]

Note:   Some browsers require an extension of HTM or HTML on the filename.  [cautionend]

ods html body='odsout.htm'; 
   proc sql outobs=12;
      title 'Coordinates of U.S. Cities';
      select * 
         from sql.uscitycoords;
ods html close;


[ODS HTML Output]

Previous Page | Next Page | Top of Page