Creating Enhanced List and Summary Reports |
Defining Variable Usage |
Using Across Variables So far, we've looked at display, analysis, order, and group variables. You can also define variables as across variables, which are functionally similar to group variables. However, PROC REPORT displays the groups that it creates for an across variable horizontally rather than vertically. Let's look at an example of across variables to clarify this usage.
The following program uses group variables to produce the output shown. The table shows unique combinations of values of the group variables, and sums of each analysis variable for each combination. |
proc report data=flights.europe nowd headline headskip; where dest in ('LON','PAR'); column flight dest mail freight revenue; define revenue / format=dollar15.2; define flight / group 'Flight/Number' width=6 center; define dest / group width=11 spacing=5 'Flight/Destination' center; run; |
Flight Number |
Flight Destination |
Freight | Revenue | |
219 | LON | 2700 | 2513 | $1,111,647.00 |
271 | PAR | 5050 | 4421 | $1,969,201.00 |
821 | LON | 4438 | 4284 | $2,077,907.00 |
Now let's suppose that you change the group variables to across variables, as in this program. |
proc report data=flights.europe nowd headline headskip; where dest in ('LON','PAR'); column flight dest mail freight revenue; define revenue / format=dollar15.2; define flight / across 'Flight/Number' width=6 center; define dest / across width=11 spacing=5 'Flight/Destination' center; run; |
In this case, for each across variable, the table cells contain a frequency count for each unique value. For each analysis variable, the table cells represent the sum of all the variable's values. |
Flight Number |
Flight Destination |
||||||
219 | 271 | 821 | LON | PAR | Freight | Revenue | |
7 | 13 | 13 | 20 | 13 | 12188 | 11218 | $5,158,755.00 |
Copyright © 2002 SAS Institute Inc.,
Cary, NC, USA. All rights reserved.