Hello,
I have dataset Test list below. I would like to get the smallest date and the largest date from the each site. For example, the result for Site 1 should be: Starting Date 2016-12-01; Ending Date 2020--5-29. Please let me know how to approach it, thank you.
data test;
format Sites 1. ScreenDate YYMMDD10.;
infile datalines dsd;
input Sites ScreenDate : yymmdd10.;
datalines;
1, 2016-12-01,
1, 2016-12-21,
1, 2018-08-15,
1, 2020-05-29,
2, 2017-12-03,
2, 2015-10-23,
2, 2016-09-14,
3, 2019-12-10,
3, 2004-12-09,
3, 2006-08-20,
3, 2016-12-10,
4, 2000-05-06,
4, 2007-12-06,
4, 2016-09-27,
;
Proc sort data=test; by sites ScreenDate; run;
... View more