Here's how I enter and work with a date as a macro variable:
%let x = %SYSEVALF('01jan2012'd);
%put &x; *see the date as sas sees it;
%put %SYSFUNC(putn(&x,yymmn.)); *see the date as yyyymm;
This is great, but I'm tired of entering dates as '01jan2012'd. In special circumstances, I might want to pass in the date as a macro variable y, where y is in the form yyyymmdd, something like this:
%let y = 20120101;
%let x = %SYSEVALF(&y);
Of course, this doesn't work. So, given y, what should I use instead of %let x = %SYSEVALF(&y); to have x as a macro variable for the date as sas sees dates?