Producing HTML Output |
Lesson
Summary![]() ![]() |
This page contains
|
I. Text Summary
To go to the page where a task, programming feature, or concept was presented, select a link. |
The Output Delivery System The Output Delivery System (ODS) makes new formatting options available to you. ODS currently supports three destinations: Output, Listing, and HTML. |
The ODS HTML Statement You use the ODS HTML statement to open the HTML destination. Use the BODY= specification to create an HTML body file containing procedure results. You can also use the ODS HTML statement to direct the HTML output from multiple procedures to the same HTML file. |
Closing the Listing Destination By default, SAS procedures display output in the Output window using list output. However, an open destination uses system resources. It's a good idea to close the Listing destination before creating HTML output. |
Creating a Linked Table of Contents In order to manage multiple pieces of procedure output, you can use the CONTENTS= and FRAME = options with the ODS HTML statement to create a table of contents that links to your HTML output. The table of contents contains a heading for each procedure that creates output. By specifying the URL= suboption in the file specification, you can provides a URL that ODS uses in all the links that it creates to the file. |
Changing the Appearance of HTML Output
|
Specifying a Path for Output You can also use the PATH= option to specify the directory where you want to store your HTML output. When you use the PATH= option, you don't need to specify the full path name for the body, contents, or frame files. |
Additional Features ODS provides ways for you to customize HTML output using style definitions. Definitions are created using PROC TEMPLATE and describe how to render the HTML output or part of the HTML output.
|
II. Syntax
To go to the page where a statement or option was presented, select a link. |
LIBNAME libref 'SAS-data-library'; |
ODS LISTING CLOSE; |
ODS
HTML PATH=file-specification |
BODY=file-specification |
CONTENTS=file-specification |
PAGE=file-specification |
FRAME=file-specification |
STYLE=style-name; |
PROC PRINT DATA=SAS-data-set; |
RUN; |
ODS HTML CLOSE; |
ODS LISTING; |
|
III. Sample Program
libname clinic 'c:\data98\patients'; ods listing close; ods html path='c:\records'(url=none) body='data.html' contents='toc.html' frame='frame.html' style=brick; proc print data=clinic.admit label; var id sex age height weight actlevel; label actlevel='Activity Level'; run; proc print data=clinic.stress2; var id resthr maxhr rechr; run; ods html close; ods listing;
|
IV. Points to Remember
|
![]() ![]() ![]() ![]() ![]() |
|
![]() |
![]() |