TABULATE Procedure

Requirements: At least one TABLE statement is required.

Depending on the variables that appear in the TABLE statement, a CLASS statement, a VAR statement, or both are required.

Tips: Supports the Output Delivery System. See Overview of How ODS Works in SAS Output Delivery System: User's Guide for details.

You can use the ATTRIB, FORMAT, LABEL, and WHERE statements with the PROC TABULATE procedure. For more information, see Statements with the Same Function in Multiple Procedures. You can also use any global statement. For a list, see Global Statements in SAS Statements: Reference.

For in-database processing to occur, your data must reside within a supported version of a DBMS that has been properly configured for SAS in-database processing. For more information, see In-Database Processing for PROC TABULATE.


PROC TABULATE <option(s)>;
BY <DESCENDING> variable-1
<…<DESCENDING> variable-n>
CLASS variable(s) </ options>;
CLASSLEV variable(s) /
STYLE=<style-element-name | PARENT>
<[style-attribute-specification(s)] >;
FREQ variable;
KEYLABEL keyword-1='description-1'
KEYWORD keyword(s) /
STYLE=<style-element-name | PARENT>
<[style-attribute-specification(s)] >;
TABLE <<page-expression,> row-expression,> column-expression</ table-option(s)>;
VAR analysis-variable(s)</ options>;
WEIGHT variable;

Table of Procedure Tasks

Statement Task Example
PROC TABULATE Statement Display descriptive statistics in tabular format Ex. 1, Ex. 2, Ex. 3, Ex. 4, Ex. 6, Ex. 8, Ex. 12, Ex. 14, Ex. 15
BY Statement Create a separate table for each BY group  
CLASS Statement Identify variables in the input data set as class variables Ex. 3, Ex. 4
CLASSLEV Statement Specify a style for class variable level value headings Ex. 14, Ex. 15
FREQ Statement Identify a variable in the input data set whose values represent the frequency of each observation  
KEYLABEL Statement Specify a label for a keyword  
KEYWORD Statement Specify a style for keyword headings Ex. 14
TABLE Statement Describe the table to create Ex. 1, Ex. 3, Ex. 4, Ex. 5, Ex. 6, Ex. 7, Ex. 8, Ex. 9, Ex. 10, Ex. 11, Ex. 12, Ex. 13, Ex. 14, Ex. 15
VAR Statement Identify variables in the input data set as analysis variables Ex. 14
WEIGHT Statement Identify a variable in the input data set whose values weight each observation in the statistical calculations