Creating Enhanced List and Summary Reports |
Defining Variable Usage |
The problem with the preceding output is that your report contains
display variables. As character variables, All of the variables in a summary report must be defined as group,
analysis, across, or computed
variables. This is because PROC REPORT must be able to summarize all
variables across an observation in order to collapse observations. If
PROC REPORT can't create groups, it displays group variables as order
variables. To group data in your report, you need to define the character variables
( |
proc report data=flights.europe nowd headline headskip; where dest in ('LON','PAR'); column flight orig dest mail freight revenue; define revenue / format=dollar15.2; define flight / group 'Flight/Number' width=6 center; define orig / group width=6 spacing=5 'Flight/Origin' center; define dest / group width=11 spacing=5 'Flight/Destination' center; run; |
Now PROC REPORT can create groups, and your summary report displays the total mail, freight, and revenue by flight number. Remember that the default statistic for the analysis variables is SUM. |
Flight Number |
Flight Origin |
Flight Destination |
Freight | Revenue | |
219 | LGA | LON | 2700 | 2513 | $1,111,647.00 |
271 | LGA | PAR | 5050 | 4421 | $1,969,201.00 |
821 | LGA | LON | 4438 | 4284 | $2,077,907.00 |
The following table compares the effects of using order variables and group variables. |
|
|
|
Rows are ordered |
|
|
Repetitious printing of values is suppressed |
|
|
Rows that have the same values are collapsed |
|
|
Type of report produced |
|
|
Copyright © 2002 SAS Institute Inc.,
Cary, NC, USA. All rights reserved.