Chapter Contents |
Previous |
Next |
The REPORT Procedure |
You can submit these statements from the PROGRAM EDITOR window with the NOWINDOWS option in the PROC REPORT statement, or you can run SAS in batch, noninteractive, or interactive line mode (see the information on running the SAS System in SAS Language Reference: Concepts).
This section provides reference information about using PROC REPORT in a windowing or nonwindowing environment. Similar information is also available online through the Help facility. For task-oriented documentation for the nonwindowing environment, see SAS Technical Report P-258, Using the REPORT Procedure in a Nonwindowing Environment, Release 6.07.
Types of Reports |
Both detail and summary reports can contain summary lines as well as detail rows. A summary line summarizes numerical data for a set of detail rows or for all detail rows. PROC REPORT provides both default and customized summaries (see Using Break Lines ).
This overview illustrates the kinds of reports that PROC REPORT can produce. The statements that create the data sets and formats used in these reports are in Selecting Variables for a Report . The formats are stored in a permanent SAS data library. See Examples for more reports and for the statements that create them.
A Sampling of Reports |
A simple PROC REPORT step produces a report similar to one produced by a simple PROC PRINT step. Simple Detail Report with a Detail Row for Each Observation illustrates the simplest kind of report that you can produce with PROC REPORT. The statements that produce the report follow. The data set and formats that the program uses are created in Selecting Variables for a Report . Although the WHERE and FORMAT statements are not essential, here they limit the amount of output and make the values easier to understand.
libname proclib 'SAS-data-library';
options nodate pageno=1 linesize=64 pagesize=60 fmtsearch=(proclib); proc report data=grocery nowd; where sector='se'; format sector $sctrfmt.; format manager $mgrfmt.; format dept $deptfmt.; format sales dollar10.2; run;
Simple Detail Report with a Detail Row for Each Observation
The report in Ordered Detail Report with Default and Customized Summaries uses the same observations as those in Simple Detail Report with a Detail Row for Each Observation . However, the statements that produce this report
For an explanation of the program that produces this report, see Ordering the Rows in a Report .
Ordered Detail Report with Default and Customized Summaries
The summary report in Summary Report with Default and Customized Summaries contains one row for each store in the northern sector. Each detail row represents four observations in the input data set--one for each department. Information about individual departments does not appear in this report. Instead, the value of Sales in each detail row is the sum of the values of Sales in all four departments. In addition to consolidating multiple observations into one row of the report, the statements that create this report
For an explanation of the program that produces this report, see Consolidating Multiple Observations into One Row of a Report .
Summary Report with Default and Customized Summaries
The summary report in Summary Report with a Column for Each Value of a Variable is similar to Summary Report with Default and Customized Summaries . The major difference is that it also includes information for individual departments. Each selected value of Department forms a column in the report. In addition, the statements that create this report
Summary Report with a Column for Each Value of a Variable
The customized report in Customized Summary Report shows each manager's store on a separate page. Only the first two pages appear here. The statements that create this report create
For an explanation of the program that produces this report, see Writing a Customized Summary on Each Page .
The report in HTML Output uses customized style elements to control things like font faces, font sizes, and justification, as well as the width of the border of the table and the width of the spacing between cells. This report was created by using the HTML destination of the Output Delivery System (ODS) and the STYLE= option in several statements in the procedure.
For an explanation of the program that produces this report, see Specifying Style Elements for HTML Output in Multiple Statements . For information on ODS, see Output Delivery System .
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.