One way of getting the min and max. Still, please elaborate what you mean by "curve".
%let ref_dttm = 20NOV20:15:00:00;
%let Dttm_min_1hr = %sysfunc(intnx(DTHOUR,"&ref_dttm"dt,-1 ),datetime16.);
%let Dttm_plus_1hr = %sysfunc(intnx(DTHOUR,"&ref_dttm"dt,+1 ), datetime16.);
%put &Dttm_min_1hr
&Dttm_plus_1hr;
proc sql;
create table work.want as
select participant_id,
min(case when dttm > "&ref_dttm"dt then . else Measure end) as min_prev_hr,
max(case when dttm < "&ref_dttm"dt then . else Measure end) as max_next_hr
from work.have
where dttm between "&Dttm_min_1hr."dt and "&Dttm_plus_1hr"dt
group by participant_id
;
quit;
... View more