Assuming your real code was already of better quality than what you've posted the reason is likely that you've enclosed the macro variable in single quotes. You need double quotes for the macro variable to resolve.
Below working sample code with all the syntax you've posted fixed.
%let prev_day = %sysfunc(intnx(day, %sysfunc(today()),-1), date9.);
%put &=prev_day;
data have;
format date_load_dttm datetime21.;
do i=-3 to 3;
date_load_dttm=intnx('dtday',datetime(),i);
output;
end;
run;
data want;
set have;
if datepart(date_load_dttm) < "&prev_day"d;
run;
Assuming your real code was already of better quality than what you've posted the reason is likely that you've enclosed the macro variable in single quotes. You need double quotes for the macro variable to resolve.
Below working sample code with all the syntax you've posted fixed.
%let prev_day = %sysfunc(intnx(day, %sysfunc(today()),-1), date9.);
%put &=prev_day;
data have;
format date_load_dttm datetime21.;
do i=-3 to 3;
date_load_dttm=intnx('dtday',datetime(),i);
output;
end;
run;
data want;
set have;
if datepart(date_load_dttm) < "&prev_day"d;
run;
Ready to join fellow brilliant minds for the SAS Hackathon?
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Follow along as SAS’ Robert Blanchard explains three aspects of autotuning in a deep learning context: globalized search, localized search and an in parallel method using SAS.