Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Proc Tabulate problem 1

Status
Not open for further replies.

PerlIsGood

Programmer
Jan 24, 2002
154
US
I'm trying to summarize data that look like this:
Code:
Example Data
CLS     PCT_LVL   VARS1-VARSx
1       A         x
1       B         x
1       C         x
2       A         x
2       B         x
3       C         x

I've been trying to summarize this data, summarizing all financial fields between classes (CLS * PCT_LVL) including a grand total at the end of the summary. Right now I'm only getting sums and percentages across PCT_LVL broken out by CLS, which is close but not quite what I need.

Code:
Example Output:
CLS    PCT_LVL    CNT   %
1      A          50    50%
1      B          5      5%
1      C          45    45%

Etc. for each CLS

This is what I've been using, but I'm not getting what I need. What am I missing?
Code:
PROC TABULATE data = rbp_3i_for_Table FORMAT=10.0;
class CLS PCT_LVL_CD app_month;
 

var rbp_3i_number_apps
    rbp_3i_number_approval 
    rbp_3i_number_decline
    rbp_3i_number_cancel
    rbp_3i_number_pending
    rbp_3i_number_decisions;
    
table (cls='Class' * PCT_LVL_CD ='PCT_LVL_CD' all='Total' * [style=[font_weight=bold]])

* (SUM='Number' * (rbp_3i_number_approval='Approved'
                   rbp_3i_number_decline='Declined'
		   rbp_3i_number_cancel='Cancelled'
		   rbp_3i_number_pending = 'Pending'
		   rbp_3i_number_apps='Total')

PCTN<rbp_3i_number_decisions>='Percentage'  * FORMAT=pc. * (rbp_3i_number_approval='Approved' rbp_3i_number_decline='Declined'
rbp_3i_number_cancel='Cancelled')),

(app_month='Month' all='Total' * [style=[font_weight=bold]])

/ BOX = 'Criteria : xxx';
title 'TITLE';
run;

Notorious P.I.G.
 
I think that's exactly what I need Chris. All I have to do if figure out how to incorporate it. :)

Thanks!

Notorious P.I.G.
 
Yeah, Tabulate isn't the easiest procedure to use. SAS has alot of code samples on their website now, it's worth checking them to see if they've got something that's a close fit.

support.sas.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top