hello, below is a simplified version of my code. what's wrong with it and how can I correct it? %macro test(mydate); %put 1 &mydate.; proc sql; select * from xx where datepart(startdate) = &mydate.; *&mydate evaluates to '31AUG2018'd ; quit; /* calculate 1 year prior */ %let mydate = %sysfunc(intnx(year,&mydate,-1,same), date9.); %put 2 &mydate.; proc sql; select * from xx where datepart(startdate) = &mydate.; *&mydate evaluates to 31AUG2017 and doesn't work; quit; %mend test; %test('31AUG2018'd);
... View more