There may be more elegant solutions, but this should do what you want, if the year and month variables are still available:
data have;
length Reporting_dt_bin $5;
Reporting_year_Bin='15';
do m=3 to 7;
Reporting_month_txt=put(m,2.);
Reporting_dt_Bin = (Reporting_year_Bin || '-' || Reporting_month_txt);
output;
end;
drop m;
run;
proc print width=min;
run;
data want;
set have;
length Reporting_dt_bin2 $5;
Reporting_dt_bin2=propcase(put(input(cats(Reporting_year_Bin,put(input(Reporting_month_txt,2.),z2.)), yymmn4.),monyy5.));
run;
proc print width=min;
run;
If only Reporting_dt_Bin is available, you could resort to this:
data have;
length Reporting_dt_bin $5;
do m=3 to 7;
Reporting_dt_bin='15-'||put(m,2.);
output;
end;
drop m;
run;
proc print width=min;
run;
data want;
set have;
length Reporting_dt_bin2 $5;
Reporting_dt_bin2=propcase(put(input(cats(scan(Reporting_dt_bin,1,'-'),put(input(scan(Reporting_dt_bin,2,'-'),2.),z2.)), yymmn4.),monyy5.));
run;
proc print width=min;
run;
If you are happy with MAR15 etc. (this is actually MONYY5. format) instead of Mar15, you can omit PROPCASE.
... View more