You have a better chance of getting an answer if you present the data that you have (and maybe also the output you want) as a datastep, e.g.:
data have;
input ID Minutes Systolic Diastolic;
cards;
3 6 123 69
3 10 110 62
3 15 111 66
3 185 137 113
4 8 118 79
4 11 73 46
4 16 85 50
4 149 141 79
;run;
I think that what you want can be accomplished like this:
data want;
set have;
by id;
if not last.id then do;
_P_=_N_+1;
set have(keep=minutes rename=(minutes=_next_)) point=_P_;
do minutes=minutes to _next_-1;
output;
end;
end;
else output;
drop _:;
run;
- assuming that your WANT table is sorted by ID and MINUTES, as was your sample.
What it does: if this is not the last record for that ID, it reads the MINUTES variable from the next record (variable _NEXT_) and outputs for the whole period up to the next record. Else, it just outputs.
... View more