Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

Share this Page URL

Chapter 20. Using the Output Delivery Sy... > Examples: Using the Output Delivery ... - Pg. 448

448 ! Chapter 20: Using the Output Delivery System Examples: Using the Output Delivery System This section provides examples of making HTML output, selecting and excluding output, tracing ODS output, using the Results window, creating ODS output data sets, modifying templates, creat- ing hyperlinks, and using ODS Graphics. Example 20.1: Creating HTML Output with ODS This example demonstrates how you can use the ODS HTML statement to display your output in HTML. The following statements create the data set Scores , which contains the golf scores of boys and girls in a physical education class: title 'Comparing Group Means'; data Scores; input Gender $ Score @@; datalines; f 75 f 76 f 80 f 77 f 80 m 82 m 80 m 85 m 85 m 78 ; f 77 m 87 f 73 m 82 The TTEST procedure is used to compare the scores. The ODS HTML statement specifies the name of the file to contain the HTML output. The following statements create the HTML file ttest.htm : ods html body='ttest.htm' style=statistical; proc ttest; class Gender; var Score; run; ods html close; By default, the LISTING destination receives all output generated during your SAS session. In this example, the ODS HTML statement opens the HTML destination as well, and both destinations receive the generated output. Note that you must specify the following statement before you can view your output in a browser: ods html close; If you do not close the HTML destination, your HTML file might contain no output or incomplete output, or you might experience other unexpected results. The following statements use ODS to display the output in HTML with a table of contents by using the STATISTICAL style of output, but this time closing the LISTING destination: