Procedure features: |
PROC PRINT statement options:
|
VAR statement option:
|
|
Other features: |
LABEL statement |
ODS PDF statement |
FORMAT statement |
TITLE
statement |
|
Data set: |
EXPREV
|
This example
-
customizes and
underlines the text in column headings for variables
-
customizes the column heading for the column that identifies observations
by number
-
shows the number of observations in the report
-
writes the values of the variable Price with dollar signs and
periods.
-
creates a default PDF report
-
creates a stylized PDF report.
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
options nodate pageno=1 linesize=80 pagesize=30 obs=10; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
proc print data=exprev split='*' n obs='Observation*Number*==========='; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
var country sale_type price; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
label country='Country Name**============'
sale_type='Order Type**=========='
price='Price Per Unit*in USD*=============='; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
format price dollar10.2;
title 'Order Type and Price Per Unit in Each Country';
run; |
Customizing Text in Column Headings: Listing Output
Order Type and Price Per Unit in Each Country 1
Observation Country Name Order Type Price Per Unit
Number in USD
=========== ============ ========== ==============
1 Antarctica Internet $92.60
2 Puerto Rico Catalog $51.20
3 Virgin Islands (U.S.) In Store $31.10
4 Aruba Catalog $123.70
5 Bahamas Catalog $113.40
6 Bermuda Catalog $41.00
7 Belize In Store $146.40
8 British Virgin Islands Catalog $40.20
9 Canada Catalog $11.80
10 Cayman Islands In Store $71.00
N = 10
You can easily create PDF output by
adding a few ODS statements. In the following example, ODS statements were
added to produce PDF output.
options nodate pageno=1 linesize=80 pagesize=40 obs=10;
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
ods pdf file='your_file.pdf'; |
proc print data=exprev split='*' n obs='Observation*Number*===========';
var country sale_type price;
label country='Country Name**============'
sale_type='Order Type**=========='
price='Price Per Unit in USD**==============';
format price dollar10.2;
title 'Order Type and Price Per Unit in Each Country';
run;
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
ods pdf close; |
Customizing Text in Column Headings: Default PDF Output
![[Customizing Text in Column Headings: Default PDF Output]](images/procprintcustcol.gif)
options nodate pageno=1 linesize=80 pagesize=40 obs=10;
ods pdf file='your_file.pdf';
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
proc print data=exprev split='*' n obs='Observation*Number*==========='
style(n) = {fontstyle=italic backgrouncolor= blue}
style(header obs obsheader) = {backgrouncolor=yellow color=blue}; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
var country sale_type price / style (data)= [ background = gray ];
label country='Country Name**====='
sale_type='Order Type**====='
price='Price Per Unit in USD**========';
format price dollar10.2;
run; |
title 'Order Type and Price Per Unit in Each Country';
run;
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
ods pdf close; |
Customizing Text in Column Headings: PDF Output Using Styles
![[Customizing Text in Column Headings: PDF Output Using Styles]](images/procprintcustcolstyle.gif)
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.