| Date: | Mon, 14 May 2007 19:23:01 -0400 |
| Reply-To: | Sigurd Hermansen <HERMANS1@WESTAT.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Sigurd Hermansen <HERMANS1@WESTAT.COM> |
| Subject: | Re: Summary of count |
|
| In-Reply-To: | <1179183220.406511.174910@w5g2000hsg.googlegroups.com> |
| Content-Type: | text/plain; charset="us-ascii" |
The summary table doesn't match the query. It appears that you have
omitted part of the SELECT list.
A query in correct syntax,
... select Type, count(*) as TotalCount
from have group by Type
;
should in your example produce the result you want. If you add other
attributes to the select list, it likely won't.
Lately I've seen a number of doctored queries, logs, and yields of
queries that don't match up correctly. Please continue to limit SAS-L
posts to essential program and log segments, as well as subsets of
results, but don't omit details that make programs inconsistent with
results.
S
-----Original Message-----
From: owner-sas-l@listserv.uga.edu [mailto:owner-sas-l@listserv.uga.edu]
On Behalf Of sdlenter
Sent: Monday, May 14, 2007 6:54 PM
To: sas-l@uga.edu
Subject: Summary of count
i have a sas dataset
Type TotalCount
aaa 2
aaa 2
ddd 4
ddd 4
ddd 4
ddd 4
I need to create another dataset that would group the fields (type) and
will look like this (without repeating)
aaa 2
ddd 4
I used this code to get "TotalCount"
PROC SQl;
Create Table new
Select Type
count(Type)as TotalCount
>From have
group by Type;
Quit;
that's how i got my table
Type TotalCount
aaa 2
aaa 2
ddd 4
ddd 4
ddd 4
ddd 4
Thanks for help
|