This code represents a call symput macro that formats the last day of the previous month. I include the output symbolgen data _null_; call symput('m',put(&pbd_date,yymmdd10.)); run; %put &m; SYMBOLGEN: Macro variable M resolves to 2014-09-30 10648 %put &m; 2014-09-30 Now I want to use &m to define the previous month and the last 2 months consecutively. The data _null_ accomplished that with no issue However if you look at the information in red, when I use the put statements I get March and April 1965 not 2014. I am scratching my head here. For those who have worked with date variables any suggestions data _NULL_; call symput ( 'curr_month1', cat("'"||put(intnx('month',&m.,-1,'e'),yymmdd10.)||"'")); call symput ( 'prev_month1', cat("'"||put(intnx('month',&m.,-2,'e'),yymmdd10.)||"'")); run; %put &curr_month1 &prev_month1; 10611 call symput ( 'curr_month1', cat("'"||put(intnx('month',&m.,-1,'e'),yymmdd10.)||"'")); SYMBOLGEN: Macro variable M resolves to 2014-09-30 10612 call symput ( 'prev_month1', cat("'"||put(intnx('month',&m.,-2,'e'),yymmdd10.)||"'")); SYMBOLGEN: Macro variable M resolves to 2014-09-30 10613 run; NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds SYMBOLGEN: Macro variable CURR_MONTH1 resolves to '1965-04-30' SYMBOLGEN: Macro variable PREV_MONTH1 resolves to '1965-03-31' 10614 %put &curr_month1 &prev_month1; '1965-04-30' '1965-03-31'
... View more