Hello everyone, I created a macrovariable within a macro to do some checks. After that there is some more SAS Coding. I need to have &report_date. and &report_date_prev. as global macrovariables because they are also used in my SAS-coding after the macro, because right now after executing the %macro check, the macro variables are not definded for the whole proram I can not build the macro around the whole code. %Macro check;
data _null_;
report_date_prev=intnx("month",today(),-1,"E");
call symputx ("report_date_prev",report_date_prev);
run;
data current_month;
set SOME TABLE;
if start_date > &report_date_prev.;
run;
proc sql noprint;
select min(start_date) format 8. into :start_date
from current_month;
quit;
data _NULL_ ;
report_date=intnx("weekday",intnx("month",today(),0,"B"),2);
call symputx ("report_date", report_date);
run;
%if %eval(&start_date. le &report_date.) %then %do;
%put Data ok;
%end;
%else %do;
%PUT ERROR: Data is not updated;
%abort;
%end;
%mend;
%check; Thank you for your help
... View more