O'Reilly logo

SAS Essentials: Mastering SAS for Data Analytics, 2nd Edition by Wayne A. Woodward, Alan C. Elliott

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

19CREATING CUSTOM REPORTS

Throughout the book, procedures such as PROC PRINT and PROC FREQ have been used to produce simple summaries of data. However, these procedures are limited. This chapter introduces two advanced reporting procedures that are designed to help you create professional reports.

19.1 USING PROC TABULATE

PROC TABULATE is used to make summary data tables. Unlike PROC FREQ, it can handle multiple levels in rows and columns. You can use PROC TABULATE to create professional reports and publication ready tables. An abbreviated syntax for PROC TABULATE is as follows:

PROC TABULATE <options>;
CLASS variables < / options>;
VAR variables < / options>;
TABLE <page> ,
 <row> ,
 column
 < / options> ;
… other statements … ;
RUN;

Table 19.1 lists commonly used options for PROC TABULATE. Moreover, Table 19.2 lists useful statements for PROC TABULATE.

Table 19.1 Common Options for PROC TABULATE

Option Explanation
DATA=dataname Specifies which data set to use
OUT=dataname Specifies an output data set
STYLE=styletype Specifies an ODS style format for the table
FORMAT= Specifies a default overall format for each cell, Best 12.2 is the default
ORDER=option Specifies order that categories are displayed. Options are UNFORMATTED, DATA, FORMATTED, and FREQ
MISSING Specifies ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required