Use proc format like follow can solve your problem easily. For example: proc format; value NewMonth '05AUG2017'd - '05SEP2017'd= "August" other = "Other"; run; data test; date='01AUG2018'd; date2='09AUG2017'd; month=put(date,newmonth.); month2=put(date2,newmonth.); run; proc print; run;
... View more