Date: Wed, 20 Feb 2008 20:07:03 -0500
Reply-To: "data _null_," <datanull@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "data _null_," <datanull@GMAIL.COM>
Subject: Re: count across all rows and colums
In-Reply-To: <624023F21le59U1@mid.individual.net>
Content-Type: text/plain; charset=ISO-8859-1
I only see 4 h's. I added one row of data. This works but I may not
scale up for your problem.
data a;input a $1. b $1. c $1.;
cards;
hjm
jm
hhh
ijk
;
run;
ods output OneWayFreqs=OneWayFreqs;
ods listing close;
proc freq;
tables _all_;
run;
ods listing;
proc print;
run;
data values;
set OneWayFreqs;
length value $1;
value = coalesceC(of F_:);
keep value frequency;
run;
proc freq noprint;
tables value / out=counts;
weight frequency;
run;
proc print;
run;
On Wed, Feb 20, 2008 at 7:48 PM, Hilly <hilly.ji@uk.co.ca> wrote:
> what would be the simplest way to summarize this across all rows and columns ?
>
> data a;input a $1. b $1. c $1.;
> cards;
> hjm
> jm
> hhh
> ;
> run;
>
> data _null_;set ;put(_all_)(=);run;
>
> in reality, I have 16 columns and about 1m rows of data
>
> desired totals
> h = 5
> j = 2
> m = 2
>
|