Hi SAS community, New with SAS, I am looking at appending table names to a string so I can do a call execute on it. %MacroPullFromDatabase(yyyymm) pulls data from database Aiming to form a string of "DATA WholeData; SET PulledData_202206 PulledData_202205 ...; RUN;" then run with call execute to form a whole table of data. I am aware that Y changes every loop and my variable don't seem to append to itself every loop, but I can't figure out how to resolve it. Appreciate any help from anyone, thanks in advance! DATA _NULL_;
n="30JUN2022"D;
m=INTNX('Month',n,-4, 'E');
do while(n>=m);
y= put(n, yymmn6.);
call execute(cats('%MacroPullFromDatabase(', y, ');'));
%LET var = CATX(" ", &var., CATS('PulledData_', y));
n=intnx('month', n, -1,'end');
end;
call execute(CATS(&var., ';RUN;'));
RUN;
... View more