Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SAS PROC REPORT

Posted on 2013-06-20
1
Medium Priority
?
620 Views
Last Modified: 2013-07-26
Working in SAS.  Need to create a report with basically column and row titles and then counts.  So the report would look like this:
                                        Region 1                 Region 2              Region 3
Total Hospitals                      6                            23                         21
Total Labs                             16                          34                         45
Total Rehabs                         3                             2                         22
Total Psych Units                  11                           5                         16
Grand Total                           35                          64                       104

Any examples in PROC PRINT or PROC REPORT to do this?  Each column to the left has a dataset with the counts
0
Comment
Question by:Lee R Liddick Jr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 11

Accepted Solution

by:
theartfuldazzler earned 2000 total points
ID: 39265085
Hi

I tend to prefer PROC TABULATE over PRINT or REPORT for this type of analysis.  TABULATE is quite a difficult to learn - but it is amazingly powerful.

Based on your question, there are multiple datasets, and I would do a summary function upfront to get the numbers:

PROC SQL;
  create view summary as
     select "Total Hospitals" as Type, Region, count(*) as Freq from Hospital group by 2
  union all
     select "Total Labs" as Type, Region, count(*) as Freq from Labs group by 2
;

PROC TABULATE DATA=Summary;
TABLE Type ALL="Grand Total", Region*Freq=" "*SUM=" ";
CLASS Type Region;
VAR Freq;
RUN;

Open in new window

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
In today's business world, data is more important than ever for informing marketing campaigns. Accessing and using data, however, may not come naturally to some creative marketing professionals. Here are four tips for adapting to wield data for insi…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question