Hi everyone! I'm using the SAS sample data set called stress99. data sasuser.stress99;
input ID $ 1-4 Name $ 7-18 RestHR 25-26 MaxHR 32-34 RecHR 39-41
TimeMin 48-49 TimeSec 57-58 Tolerance $ 65 Year 70-73;
datalines;
2501 Bonaventure, T 78 177 139 11 13 I 1999
2544 Jones, M 79 187 136 12 26 N 1999
2552 Reberson, P 69 158 139 15 41 D 1999
2568 Eberhardt, S 72 182 122 16 49 N 1999
2571 Nunnelly, A 65 181 141 15 2 I 1999
2578 Cameron, L 75 158 108 14 27 I 1999
2579 Underwood, K 72 165 127 13 19 S 1999
2588 Ivan, H 70 182 126 15 41 N 1999
2595 Warren, C 77 170 136 12 10 S 1999
; Now what I would like to do is to create a data set that holds only the smallest value for TimeMin, which would be TimeMin=11. I tried: proc sort data = sasuser.stress99; by timemin; run;
data bla (drop = resthr maxhr rechr tolerance timesec year);
set sasuser.stress99;
by timemin;
first_time= first.timemin; if first.timemin;
run; But what it will give me is the first UNIQUE value for TimeMin. Where am I going wrong? I found this solution and I don't see why it works in their example but not in mine. Thank you!
... View more