The PRINT Procedure |
Procedure features: |
| ||||||||
Other Features: |
| ||||||||
Data set: | EXPREV |
Program Description |
This example
selects three variables for the reports
uses variable labels as column headings
double spaces between rows of the report
creates a default HTML report
creates a stylized HTML report.
Program: Creating a Listing Report |
options nodate pageno=1 linesize=80 pagesize=30 obs=10; |
proc print data=exprev double; |
var country price sale_type; |
title 'Monthly Price Per Unit and Sale Type for Each Country'; footnote '*prices in USD'; run; |
Output: Listing |
Selecting Variables: Listing Output
Selecting Variables: Listing Output
Monthly Price Per Unit and Sale Type for Each Country 1 Sale_ Obs Country Price Type 1 Antarctica 92.6 Internet 2 Puerto Rico 51.2 Catalog 3 Virgin Islands (U.S.) 31.1 In Store 4 Aruba 123.7 Catalog 5 Bahamas 113.4 Catalog 6 Bermuda 41.0 Catalog 7 Belize 146.4 In Store 8 British Virgin Islands 40.2 Catalog 9 Canada 11.8 Catalog 10 Cayman Islands 71.0 In Store *prices in USD
Program: Creating an HTML Report |
You can easily create HTML output by adding ODS statements. In the following example, ODS statements are added to produce HTML output.
options nodate pageno=1 linesize=80 pagesize=30 obs=10;
ods html file='your_file.html'; |
proc print data=exprev double;
var country price sale_type; title 'Monthly Price Per Unit and Sale Type for Each Country'; footnote '*prices in USD'; run;
run;
ods html close; |
Output: HTML |
Selecting Variables: Default HTML Output
Program: Creating an HTML Report with the STYLE and BLANKLINE Options |
You can go a step further and add more formatting to your HTML output. The following example uses the STYLE option to add shading and spacing to your HTML report.
options nodate pageno=1 linesize=80 pagesize=40 obs=5;
ods html file='your_file_styles.html';
proc print data=exprev double style(header) = {fontstyle=italic color= white} style(obs) = {backgroundcolor=red} blankline=(count=1 style={backgroundcolor=red}); |
var country price sale_type;
title 'Monthly Price Per Unit and Sale Type for Each Country'; footnote '*prices in USD'; run;
run;
ods html close; |
Output: HTML Output with Styles |
Selecting Variables: HTML Output Using Styles
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.