I'm trying to resolve an macro which changes during loop execution since i have defined it inside a single quote it's not getting resolved
%do m = 1 %to 10;
proc sql noprint;
connect to POSTGRES (&prep_con_str);
select run_date
into :m_batch_dt
from connection to POSTGRES (
select min(run_date) - INTERVAL '&m. day' as run_date
from dummy;
);
disconnect from POSTGRES;
quit;
%end;
If postgres allows it, change to double quotes.
If not, maybe try macro quoting, e.g.: