|Date: ||Thu, 2 Apr 2009 08:37:37 -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: proc sql;|
|Content-Type: ||text/plain; charset="us-ascii"|
If I understand your explanation correctly, you want a summarization of
your data, by ITEM, with DEMAND1 representing the number of observations
where the DEMAND for that item is 0. Is that correct?
If so, I think the following SQL code will do.
infile cards missover;
input item $ demand;
select item, sum(case when demand = 0 then 1 else 0 end) as demand1
group by item
Senior Research Analyst
From: mahesh kumar peesari [mailto:email@example.com]
Sent: Thursday, April 02, 2009 8:27 AM
To: Jack Clark
Subject: Re: proc sql;
Actually i have dataset with 12000 observations and columns it has are
date(month wise),item and demand.so my requirement is whenever the the
demand is 0,i want to club the demand when zero accordingly to the item
i can do it,but my distinct item no.s are 5000 when i run this query..
create table asdf as select distinct(item),count(demand)
from Examples.as group by lptno where demand=0 ;
i am getting my output with distinct item no of 4843 because
of the where condition but i still want the remaining item
whose demand is not zero in my new data set.
On Thu, Apr 2, 2009 at 5:51 PM, Jack Clark <firstname.lastname@example.org>
What are you trying to do to the data to get the desired output? How is
Senior Research Analyst
University of Maryland, Baltimore County
Sondheim Hall, 3rd Floor
1000 Hilltop Circle
Baltimore, MD 21250
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
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
SUBSCRIBE SAS-L Joe H. Smith
Sent: Thursday, April 02, 2009 8:16 AM
Subject: proc sql;
i have data like this...
I want my output like this
i have tried using proc sql but i cant do this...
can an yone of you help me please..
Thanks & regards
Jack Off All Trades....But Master Of None...