SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Creating Tabular Reports
Specifying Variables


After you invoke PROC TABULATE and identify your data set, you need to specify variables to create your tables.

As you saw earlier, you need to distinguish between variables that classify your data (into groups, or categories, or classes) and variables used for arithmetic analysis. These are called class variables and analysis variables, respectively. You list

  • class variables in a CLASS statement
  • analysis variables in a VAR statement.

General form, CLASS and VAR statements:
CLASS variable(s);
VAR
variable(s);

NOTE: In these statements, you simply list variables in any order, separated by blanks. You can write either statement first.


The statements below specify that values of Sex be used as categories and that Age, Height, and Weight be used for analysis.
     class sex;
     var age height weight;

Note that the CLASS and VAR statements do not specify the order in which variables appear in the table.


Distinguishing Class and Analysis Variables

Specifying some variables is relatively easy, as shown in the following statements. AerClass, WalkJogRun, and Swim are variables used to calculate statistics about participation in exercise. Date categorizes attendance in the exercise groups by date.

     var aerclass walkjogrun swim;
     class date;

But it's not always so simple to decide which variables to specify as class variables and which to specify as analysis variables.



back||next


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

Terms of Use & Legal Information | Privacy Statement