Date: Mon, 20 Jun 2011 15:37:13 -0400
Reply-To: Jack Clark <jclark@HILLTOP.UMBC.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jack Clark <jclark@HILLTOP.UMBC.EDU>
Subject: Re: A Count question
In-Reply-To: A<201106201908.p5KAmBJm006027@willow.cc.uga.edu>
Content-Type: text/plain; charset="us-ascii"
Tom,
Proc sql;
Create table need as
Select subject, count(distinct parts) as parts
From have
Group by subject
;
Quit;
Jack
Jack Clark
Senior Programmer
phone: 410-455-6256
fax: 410-455-6850
jclark@hilltop.umbc.edu
University of Maryland, Baltimore County
Sondheim Hall, 3rd Floor
1000 Hilltop Circle
Baltimore, MD 21250
Please consider the environment before printing this e-mail and/or any attachments.
Confidentiality Notice: This e-mail may contain information that is legally privileged and that is intended only for the use of the addressee(s) named above. If you are not the intended recipient, you are hereby notified that any disclosure, copying of this e-mail, distribution, or action taken in reliance on the contents of this e-mail and/or documents attributed to this e-mail is strictly prohibited. If you have received this information in error, please notify the sender immediately by phone and delete this entire e-mail. Thank you.-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Tom
Smith
Sent: Monday, June 20, 2011 3:09 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: A Count question
I have a following dataset with two variables: subject (Charecter)
parts
(numeric):
subject parts
------- -----
1001 1
1001 1
1001 2
2003 3
2003 4
2003 10
I need to count how many different values for the variable "part" by
subject is available.
the output should be as below:
subject parts
------- -----
1002 2
2003 3
Thanks a lot.