Hello,
As explained by @ChrisBrooks, when no new record is retrieved by a set statement, SAS stops processing further instructions
and exits the data step.
You can use instead a merge statement as follows :
data test;
format dt date9. count best.;
stop;
run;
%macro update(ds, date);
data newdate;
dt=&date.;
run;
data &ds.;
merge newdate (in=innew) &ds. (in=date_exists);
by dt;
if innew then do;
if date_exists then count+1;
else count=1;
end;
run;
%mend;
data _NULL_;
call symputx("yesterday", intnx('day',today(),-1));
call symputx("today", today());
run;
%put &yesterday. &today.;
%update(test, &yesterday.);
%update(test, &yesterday.);
%update(test, &today.);
%update(test, &today.);
%update(test, &today.);
... View more