Date: Sat, 17 May 2008 09:56:26 -0400
Reply-To: Ken Borowiak <EvilPettingZoo97@AOL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Ken Borowiak <EvilPettingZoo97@AOL.COM>
Subject: Re: question about creating a data subset
On Fri, 16 May 2008 14:08:15 -0400, Jack Clark <JClark@CHPDM.UMBC.EDU> wrote:
>Here is a PROC SQL approach. The sort you have in your code is not
>necessary.
>
>proc sql;
> select *
> from practice_dates
> where id in (select distinct id
> from practice_dates
> where passed = 'Y')
> ;
>quit;
>
>
>Jack Clark
>Research Analyst
>Center for Health Program Development and Management
>University of Maryland, Baltimore County
>
>
>-----Original Message-----
>From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
>geraden72011
>Sent: Friday, May 16, 2008 1:54 PM
>To: SAS-L@LISTSERV.UGA.EDU
>Subject: question about creating a data subset
>
>I have the following example i created:
>
>data practice_dates;
>input id date mmddyy8. test passed $;
>format date mmddyy10.;
>datalines;
>1234 01021969 2345 Y
>1234 01301969 3456 N
>3157 02031969 2345 N
>3157 02201969 2897 N
>3157 04151969 2345 Y
>1011 02051969 2345 N
>1011 02211969 2345 N
>1011 05201969 2897 N
>2468 03211969 2234 Y
>2468 07151969 2255 Y
>;
>proc sort data=practice_dates;
>by id date;
>run;
>
>What I want to do is to create a new datafile that has all of the
>records for the ID's that have a passed = 'Y' for any of the tests.
>
>so for the above example my new datafile would have all of the
>following
>
>1234 01021969 2345 Y
>1234 01301969 3456 N
>3157 02031969 2345 N
>3157 02201969 2897 N
>3157 04151969 2345 Y
>2468 03211969 2234 Y
>2468 07151969 2255 Y
>
>any help is greatly appreciated.
|