Вы можете обратиться к следующему коду для этого
data have;
dt='Mar2017';
output;
dt='Apr2017';
output;
dt='May2017';
output;
dt='Aug2017';
output;
run;
data want;
set have;
newdt=input(dt,MONYY7.); /*Convert text into date, it will point to first day*/
lastDay=intnx ('month',newdt,0,'E'); /*Find the last day of month*/
format newdt lastDay date9.;
run;