Date: Fri, 17 Nov 2000 09:31:18 -0800
Reply-To: "Huang, Ya" <ya.huang@AGOURON.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Huang, Ya" <ya.huang@AGOURON.COM>
Subject: Re: retrieving records
Content-Type: multipart/alternative;
Xihu,
See the following:
data xx;
input id t1 t2 t3;
cards;
1 23 42 15
1 98 98 98
2 30 21 45
2 34 33 45
2 98 98 98
3 98 98 98
3 98 98 98
4 98 98 98
4 98 98 98
;
options nocenter;
proc sql;
select *
from xx
group by id
having count(id)*3=sum((t1=98)+(t2=98)+(t3=98))
;
---------------------------
The SAS System 09:24 Friday, November 17, 2000 2
id t1 t2 t3
------------------------------------------
3 98 98 98
3 98 98 98
4 98 98 98
4 98 98 98
Regards,
Ya Huang
-----Original Message-----
From: xihu lu [mailto:xihulu@YAHOO.COM]
Sent: Friday, November 17, 2000 9:11 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: retrieving records
Hello there,
The following is the dataset in question:
id t1 t2 t3
1 23 42 15
1 98 98 98
2 30 21 45
2 34 33 45
2 98 98 98
3 98 98 98
3 98 98 98
4 98 98 98
4 98 98 98
Each id can have a number of records. I'd like to find
out
how many ids have a value of '98' for all records
under all
three fields (i.e. t1, t2, t3). In this case, the
output
will be :
3 98 98 98
3 98 98 98
4 98 98 98
4 98 98 98
Could someone help me achieve this? Many thanks.
Xihu
__________________________________________________
Do You Yahoo!?
Yahoo! Calendar - Get organized for the holidays!
http://calendar.yahoo.com/
[text/html]