The PRINT Procedure |
What Does the PRINT Procedure Do? |
The PRINT procedure prints the observations in a SAS data set, using all or some of the variables. You can create a variety of reports ranging from a simple listing to a highly customized report that groups the data and calculates totals and subtotals for numeric variables.
Simple Listing Report |
The following output illustrates the simplest kind of report that you can produce. The statements that produce the output follow. Selecting Variables to Print creates the data set EXPREV.
options nodate pageno=1 linesize=64 pagesize=60 obs=10;
proc print data=exprev; run;
Simple Listing Report Produced with PROC PRINT
The SAS System 1 Order_ Obs Country Emp_ID Date 1 Antarctica 99999999 1/1/08 2 Puerto Rico 99999999 1/1/08 3 Virgin Islands (U.S.) 99999999 1/1/08 4 Aruba 99999999 1/1/08 5 Bahamas 99999999 1/1/08 6 Bermuda 99999999 1/1/08 7 Belize 120458 1/2/08 8 British Virgin Islands 99999999 1/2/08 9 Canada 99999999 1/2/08 10 Cayman Islands 120454 1/2/08 Ship_ Sale_ Obs Date Type Quantity Price Cost 1 1/7/08 Internet 2 92.6 20.70 2 1/5/08 Catalog 14 51.2 12.10 3 1/4/08 In Store 25 31.1 15.65 4 1/4/08 Catalog 30 123.7 59.00 5 1/4/08 Catalog 8 113.4 28.45 6 1/4/08 Catalog 7 41.0 9.25 7 1/2/08 In Store 2 146.4 36.70 8 1/5/08 Catalog 11 40.2 20.20 9 1/5/08 Catalog 100 11.8 5.00 10 1/2/08 In Store 20 71.0 32.30
Customized Report |
The following HTML report is a customized report that is produced by PROC PRINT using ODS. The statements that create this report do the following:
create HTML output
customize the appearance of the report
customize the title and the column headings
place dollar signs and commas in numeric output
selectively include and control the order of variables in the report
group the data by JobCode
sum the values for Salary for each job code and for all job codes.
For an explanation of the program that produces this report, see Program: Creating an HTML Report with the STYLE Option.
Customized Report Produced by PROC PRINT Using ODS
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.