Solved

SAS PROC REPORT

Posted on 2013-06-20
1
597 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
1 Comment
 
LVL 11

Accepted Solution

by:
theartfuldazzler earned 500 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

Independent Software Vendors: 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

Suggested Solutions

Title # Comments Views Activity
MS SQL Server COnditional Where statement 7 95
subtr returning incorrect value 8 63
Hive vs Impla in Hadoop 1 71
Access table not showing correct column 6 16
SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

679 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