data _NULL_;
month = month(input("&sysdate9",date9.));
year = year(input("&sysdate9",date9.));
call symput('month',compress(put(month,best.)));
call symput('year',compress(put(year,best.)));
run;
Output is
44 %put &year;
SYMBOLGEN: Macro variable YEAR resolves to 2017
2017
45 %put &month;
SYMBOLGEN: Macro variable MONTH resolves to 11
Based on this month of November and this year.
I have a report that will require me to go back several quarters and years. I have a start up program that will give me the desired time period so lets say I need to not only pull November 2017 but I need to pull another date, say June 30, 2017? How can I put in code like above to get me the desired date. Quarterly would be even better (ie jan-mar=qtr1, apr-jun=qtr2 etx
... View more