I am trying to pass a date macro variable into another macro variable and unable to do that. Here is the code that I am using LET TODAY = %sysfunc(TODAY(),DATE9.); data dates; lastwk=intnx('week', "&TODAY."D, -2); last7wk=intnx('week', "&TODAY."D, -8); lastSun= intnx('week.1', lastwk , 1); last7Sun= intnx('week.1', last7wk , 1); format lastwk date9.; format last7wk date9.; format last7Sun date9.; format lastSun date9.; call symput('lastwk',lastwk); call symput('lastwk_Sun',lastwk); call symput('last7Sun',last7Sun); call symput('lastSun',lastSun); run; %macro test(V1=,V2=,V3=); select * , case when No in (1648,1653,1612, 1650)then 'Express' when No in (1638,1634,1637,1661) then 'Non-Express' else 'none' End as Mode from ( SELECT * FROM XXXX.ABCD t1 WHERE t1.ACTION_DATE>=&V1. and t1.ACTION_DATE< &V2. and t1.No in (1648,1653,1612, 1650, 1638,1634,1637,1661,1974,1975,1976) and LEVEL_CD='&V3' ) T1 %mend; proc sql; create table table_2 as select * From (%test(V1=&last7Sun.,V2==&lastSun.,V3=2) )T2 ; Quit; Thanks in Advance.
... View more