LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (May 2007, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments:   To: sdlenter <sdlentert@aol.com>
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


Back to: Top of message | Previous page | Main SAS-L page