Your EOF macro reading in the data set could check for zero observations and report that status to the log, otherwise leaving the data set unmodified. Is that what you are looking for?
Here's an example using sashelp.class data set:
data m f uncoded;
set sashelp.class;
if sex='M' then output m;
else if sex='F' then output f;
else output uncoded;
run;
%macro eof(sex);
data &sex;
if nrecs=0 then do;
put "No Observations in &sex";
stop;
end;
if eof then output;
modify &sex nobs=nrecs end=eof;
run;
%mend eof;
options mprint;
%eof(m);
%eof(f);
%eof(uncoded);
It might seem counterintuitive to have an if-test for NRECS=0 preceding the apparent assignment of a value to nrecs in the MODIFY statement. But that's because the assignment of a value to nrecs is done at the data step compiler stage, not the execution stage.