please try the below code
if there is only year like 2011 then I imputed it to 01-01, let me know if that works for the other imputation suggested is followed.
data have;
input id date1 $10. date2 $11. ;
if length(date1)<10 then cd1=intnx('month',input(cats(date1,'-01'),yymmdd10.),0,'e');
else if length(date1)>=10 then cd1=input(date1,anydtdte10.);
if length(date2)<=4 then cd2=intnx('year',input(cats(date2,'-01-01'),yymmdd10.),0,'s');
else if 4< length(date2)<10 then cd2=intnx('month',input(cats(date2,'-01'),yymmdd10.),0,'e');
else if length(date2)>=10 then cd2=input(date2,anydtdte10.);
if cd2<cd1 then want='early';
else want='late';
format cd: date9.;
datalines;
1 05/21/2010 2013-03-21
2 2011-03-01 2011-01-21
3 2014-03 2011
4 2015-01 2015-05
;
... View more