You want to output all records up through the first positive (criteria_met='yes'). So all you need to do is keep a running count of the number of positives encountered (N_POS in the program below).
Notes:
The program below assumes the data are grouped by PT_ID (and sorted by date within each PT_ID group). But, while grouped by PT_ID, it appears not to be in ascending PT_ID order - hence the "by pt_id NOTSORTED". If it's not grouped, or not sorted by date within PT_ID, then sort dataset have by PT_ID/date first.
The subsetting "if n_pos=0" might make you think that only records BEFORE the first positive will be output. But note that N_POS is not updated until after the subsetting if - as a result the first positive will be output, even though N_POS has become 1. All subsequent records within a PT_ID will be filtered out. If you want to see the evidence remove the "drop n_pos" statement and look at the output.
data have;
input PT_ID$ date: ddmmyy10. result criteria_met$;
format date date9.;
cards;
x 1/1/2015 500 yes
x 2/1/2015 470 no
x 3/1/2015 525 yes
z 2/2/2015 450 no
z 3/3/2015 575 yes
k 5/4/2015 650 yes
;
data want;
set have;
by pt_id notsorted;
if first.pt_id then n_pos=0;
if n_pos=0;
n_pos + (criteria_met='yes');
drop n_pos;
run;
... View more