Use the intnx function to return the same day of the previous month: intnx('month',datevar,-1,'s'). SAS designed this very intelligently for month's with 31 days. In the event that the previous month does not have as many days, it will default to the end of the month. So running this with a current date of 3/29/2014 would return 2/28/2014 as the same day from the previous month. Then, rather than build your own string, just use the date11 format: data _null_; dd = day(today()); pd = intnx('month',dd,-1,'s'); CALL SYMPUT('bur_str_m1', "'"||put(pd,date11.)||"'"); run;
... View more