Date: Wed, 2 Jul 2003 11:45:50 -0700
Reply-To: Kristie Beth <kristie_35_89@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Kristie Beth <kristie_35_89@YAHOO.COM>
Subject: proc sql
Content-Type: text/plain; charset=us-ascii
Hi, I have another question (thanks so much for the other help!), this is on proc sql, I am not understanding why or HOW the 'case when' works
For example, if I have the following code,
proc sql,
select patid,
case
when target is not missing then min(date)
from dataset
where target is not missing or target2 is not missing
group by patid
order by patid
quit;
What I want to get is the min. date when the variable target is not missing but this code I have written doesn't achieve this. What's wrong? Also, I am trying to get the minimum of multiple variables, not just one but all have the condition of where target is not missing OR target2 is not missing.
I have read the documentation thru and thru on proc sql but still, the conditional statements seem to a problem...
thanks, Kristie
---------------------------------
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
|