List observations in a data set and summarize selected numeric variables. Summarize over all observations and summarize within groups. Summarize specific variables within an observation and add these summaries as columns in the report. Display the summary columns. Do not display the variables used to calculate the summaries.
Regional Energy Quarterly Use by Residential and Commercial Customers First Second Quarter Quarter Service Total Total Total Commercial Area Lights 36,058 36,296 72,354 Flood Lights 39,061 36,082 75,143 General Service 2,572 2,977 5,549 Off Peak 40,206 35,634 75,840 Other Service 4,700 4,851 9,551 Space Heating 317 337 654 Water Heating 458 389 847 =========== ======== ======== ======== Commercial 123,372 116,566 239,938 =========== ======== ======== ======== Residential Area Lights 325 324 649 Flood Lights 260 244 504 General Service 66,342 74,132 140,474 Off Peak 3,212 3,073 6,285 Other Service 633 656 1,289 Space Heating 29,375 38,029 67,404 Water Heating 34,374 34,376 68,750 =========== ======== ======== ======== Residential 134,521 150,834 285,355 =========== ======== ======== ======== ======== ======== ======== 257,893 267,400 525,293 ======== ======== ======== |
Data Set | POWERUSE |
Featured Step | PROC REPORT |
Featured Step Statements and Options | DEFINE statement: ANALYSIS, COMPUTED, NOPRINT, ORDER, and SUM options
COMPUTE blocks to create new variables BREAK AFTER statement: SUMMARIZE option RBREAK AFTER statement: SUMMARIZE option |
Formatting Features | Controlling line breaks in column headings
DEFINE statement: WIDTH option when sending output to the LISTING destination. BREAK and RBREAK statements: DOL, DUL, and SKIP options when sending output to the LISTING destination |
Other Examples That Use This Data Set | Examples 2.4, 2.5, and 6.10 |
This report includes only the summary columns from Example 2.5. It presents energy usage by type of service for commercial and residential customers by quarter. This example sums columns and rows. It suppresses the display of the analysis variables used to compute the quarter totals, which were displayed in Example 2.5.
Each detail row in the report—those with a value for SERVICE—corresponds to one observation in the POWERUSE data set. The other rows, which are summaries of the detail rows, were created by the PROC REPORT statements, BREAK and RBREAK.
The columns for customer group and type of service each correspond to a variable in the POWERUSE data set. PROC REPORT defines the other three columns. It calculates their values with programming statements in COMPUTE blocks. The calculations sum the monthly usage variables in the POWERUSE data set.
PROC REPORT reference and usage information. See “The REPORT Procedure” in the “Procedures” section of Base SAS 9.1 Procedures Guide.
3.145.161.228