SAS OnlineTutor HomeFAQ PageSuggested Learning PathContents+Searchback||next

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, Orig and Dest are defined as display variables by default.

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.


Revising the Report

To group data in your report, you need to define the character variables (Flight, Orig, and Dest) as group variables, as shown below:


     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
Mail 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.



 
 ORDER 
 GROUP 
Rows are ordered
yes
yes
Repetitious printing of values is suppressed
yes
yes
Rows that have the same values are collapsed
no
yes
Type of report produced
list
summary


back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement