Looks like the macro %SNAPSHOTDATE() is calling SQL server. How does this macro expect its parameters formatted? You do not need the macro %YER() to generate the dates to call the other macro. Either just do the formatting in a data step or even in open code using %SYFUNC() calls. It is not clear what you want to do but if you want to find the previous month or quarter you can use the INTNX() function with a negative offset. %let today=%sysfunc(today()); %let lastmonth=%sysfunc(intnx(month,&today,-1)); If you want the date in a particular format then use a format on the %SYSFUNC() call. %let lastqtr = %sysfunc(intnx(month,&today,-1),YYQ6.); LASTQTR = 2014Q1
... View more