Well, month should have quotes around it, that might be it, this works fine however, and I can't tell from what you have posted:
data temp;
set sashelp.class;
datadate='09JAN2017'd;
format datadate date9.;
run;
%macro table_creation (d=);
proc sql ;
create table INFO as
select *
from TEMP
where SEX in ('M')
and intnx('month',"&d."d,-3) <= datadate <= "&d."d;
quit;
%mend table_creation;
%table_creation (d=31DEC2016);
... View more