This should get you going.
data have;
input GROUP DOSE (START END)(:mmddyy10.);
infile datalines missover;
format START END mmddyy10.;
datalines;
1 40 8/24/2022 9/22/2022
1 70 9/23/2022 10/7/2022
1 70 10/9/2022 10/13/2022
1 64 10/15/2022 10/19/2022
1 48 10/21/2022
2 35 8/1/2022 8/14/2022
2 70 8/15/2022 8/19/2022
2 80 8/20/2022 8/30/2022
2 90 8/31/2022 9/11/2022
2 90 9/12/2022 9/25/2022
2 50 9/26/2022 10/2/2022
2 35 10/4/2022 10/10/2022
2 35 10/11/2022 10/25/2022
2 20 10/26/2022 11/1/2022
2 10 11/2/2022
;
data want;
set have;
by group;
if first.group then _start = 'Y';
if last.group then _end = 'Y';
increase = ifc(dif(dose) > 0 & first.group = 0, 'Y', '');
decrease = ifc(dif(dose) < 0 & first.group = 0, 'Y', '');
run;
... View more