BookmarkSubscribeRSS Feed
Calcite | Level 5
Can anyone tell me what exactly is the difference between Proc Report and Proc Tabulate?
Proc Tabulate only produces summary reports, based on class and analysis variables. These summary reports are always tabular in structure, with 3 possible dimensions -- page, row and column dimension.

Proc Report produces both "detail" and summary reports. A detail report is a report where one report row represents one observation from the input data set. A summary report is a report where one report row represents a group of observations. Both detail reports and summary reports can have inter-group or overall report summary lines added to the report.

For example, if you have 100 employees spread across 3 states and 5 departments, a report that listed each employee and their salary would be a DETAIL report. It would have at least 100 report rows if you picked all employees. On the other hand, a summary report of average salaries for each state would NOT have 100 report rows -- it would only have 3 report rows -- one for each state. Or if you summarized by STATE and DEPARTMENT, you might have one row for every unique combination of STATE and DEPARTMENT, but not more than 15 (3 states *5 departments), unless you added summary rows (total for each state, total for each department or overall total) to the report.

There are too many features of each procedure to list here. It takes a 3 day class to provide thorough coverage of ODS, PROC TABULATE and PROC REPORT. I suggest you take some familiar data and experiment with REPORT versus TABULATE syntax. Or, you can search for more papers like these:

Not applicable
Proc tabulate produces cross tabular reports and proc report produces simple table reports.

I tend to create a lot of reports which involve calculations based on other columns within the report. This is tricky to do in proc tabulate or sometimes impossible. Proc report gives you the ability to use the compute syntax allowing you to do calculations.

Having said this i tend to summarize a lot of my data in proc report, output a data table then turn this round into a proc tabulate if you want a cross tabulate report.

Hope this helps make up your mind, but both reports offer different things you just need to think about how your data is organized to start with and how complex calculations are that you need.
PROC REPORT also supports cross-tabular table creation with the ACROSS usage in the DEFINE statement. As you can see, both procedures are capable of producing the same cross-tabular report. The fact is that for simple cross-tabs, you could use either procedure. For more complicated cross-tabs -- where there are a LOT of nestings in the row and column dimension, my tendency is to use PROC TABULATE.


proc sort out=shoes;
by region product;
where region in ('Asia', 'Canada', 'Pacific') and
product contains 'Dress' or product contains 'Casual';

ods listing close;
ods html file='c:\temp\report_cross.html' style=sasweb;
proc report data=shoes nowd
title '1) With Proc Report';
column region product,(sales returns) ('Total' sales=totsales returns=totreturns);
define region /group style(column)=Header;
define product / across;
define sales / sum 'Sales';
define returns / sum 'Returns';
define totsales / sum 'Sales';
define totreturns / sum 'Returns';
rbreak after / summarize;
compute after;
region = 'Total';

proc tabulate data=shoes f=dollar14.0;
title '2) With Proc Tabulate';
class region product;
var sales returns;
table region all*{s=Header},
product*(sales returns) all*(sales returns) /
keylabel sum=' '
all = 'Total';
label sales = 'Sales'
returns = 'Returns';

ods html close;


Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.


Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 3 in conversation