SAS OnlineTutor HomeFAQ PageSuggested Learning PathContents+Searchback||next

Creating Enhanced List and Summary Reports
Defining Variable Usage


So far, you've selected data for your list report and have defined column attributes and headings. Next, let's look at a more complex PROC REPORT feature: usage for variables in your report. You've seen that you define variable usage in the DEFINE statement. Now you can see how each usage affects the layout of your report and the values that the report contains.


How PROC REPORT Uses Variables

PROC REPORT uses each variable in one of six ways (DISPLAY, ORDER, GROUP, ACROSS, ANALYSIS, or COMPUTED). By default, PROC REPORT uses

  • character variables as display variables
  • numeric variables as analysis variables, which are used to calculate the SUM statistic.

Because you haven't explicitly defined any variable usages, your current list report contains only display and analysis variables:

  • The character variables Flight, Orig, and Dest are display variables. Display variables don't affect the order of rows in the report. A report that contains one or more display variables has a detail row for each observation that is read from the data set. Each detail row contains a value for each display variable.

  • The numeric variables Mail, Freight, and Revenue are analysis variables. Analysis variables are used to calculate a statistic (in this case, the default SUM).

In the illustration below, columns for display variables are shown in white. Columns for analysis variables are shown in gray.



character
variables


(default=
DISPLAY)

Illustration of Partial PROC REPORT Output
Flight
Number
Flight
Origin
Flight
Destination
Mail Freight Revenue
821
LGA
LON
403 209 $150,634.00
271
LGA
PAR
492 308 $156,804.00
271
LGA
PAR
366 498 $190,098.00
821
LGA
LON
345 243 $150,634.00
821
LGA
LON
248 307 $193,930.00
numeric
variables


(default=
ANALYSIS)


How you use a variable in a report determines, among other things, the order of the rows in your report. Let's see the effect of defining a variable as an order variable.

back||next


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

Terms of Use & Legal Information | Privacy Statement