proc format;
invalue days "01","03","05","07","08","10","12"=31
"04","06","09","11"=30
"02"=28;
run;
data test;
input yymm $;
cards;
200808
200802
200002
201002
198712
200304
;
data wanted;
set test;
y=substr(yymm,1,4);
m=substr(yymm,5);
d=input(m,days.);
if mod(y,400)=0 or (mod(y,4)=0 and mod(y,100)^=0) then d=ifn(m="02",d+1,d);
run;