« iPhone not up to par yet | Main | SAS coding fun »

SAS coding fun - another solution

Yesterday's fun SAS code has another solution, this time using Proc SQL. 

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;

proc sql;
   select *
   from   practice_dates
   where  id in (select distinct id
                 from   practice_dates
                 where  passed = 'Y')
   ;
quit; 

Posted on Thursday, June 5, 2008 by Registered CommenterJared in | CommentsPost a Comment

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>