If there are no other variables you want to keep then just group by ID and DATE2 and take MIN(DATE1) as your DATE values. If there are other variables you are keeping then you could try using a HAVING() clause, but unless you have unique dates from both datasets you cannot do it directly in SQL code as you could still get multiple observations if there are two DATE1 values that are the same in the same ID , DATE2 group.
So just use a data step. So if you have this data, sorted by ID DATE2 and DATE1 .
data have;
id date1 :mmddyy. date2 :mmddyy.; format date1 date2 mmddyy10.;
datalines;
a 1/1/2008 .
a 1/1/2009 .
a 1/1/2010 1/1/2009
a 1/1/2011 1/1/2009
a 1/1/2011 1/1/2010
;
Then run this step to reduce to the first observation per ID and DATE1.
data want;
set have;
by id date2 date1;
if first.date2;
run;
... View more