Date: Wed, 11 Mar 2009 18:52:54 -0700
Reply-To: tanwanzang@YAHOO.COM
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: tanwanzang@YAHOO.COM
Organization: http://groups.google.com
Subject: Re: sum and count in one Proc tabulate
Content-Type: text/plain; charset=ISO-8859-1
I do not know how TABULATE, for all its elegancy can do what you want.
If you really have to do this, then you need to create a new variable
that is the sum of the the other two variables
in a data step.
data meek;
input level $ var1 var2;
cards;
A 1 10
A 2 3
B 3 3
B 5 6
b 1 1
B 8 3
;
data meek_view
/ view=meek_view;
set meek;
var3=sum(var1, var2); *create summ variable here;
proc tabulate data = meek_view noseps;
class level;
var var: ;
tables level,
(var1) *(sum="Sum" N='Count' )*f=comma7.
(var2) *(sum="Sum" N='Count' )*f=comma7.
(var3) *(sum="Total Sum" )*f=comma7.
;run;
|