Mabye someone can lend some advice here. I am using SAS to run an interval report hourly that auto emails to a dist list.
I run 4 different summary statistics reports, join them into one report report, export them to pdf and email them to a distribution list hourly throughout the day. It's an automated process that i have running on my system.
What is happening is that one of the reports sometimes has an empty dataset, and therefore when the automated process runs, it doesn't generate anything for that statistics summary table and the report ends up with the prior hours information, which is confusing my audience.
Is it possible to force the summary statistics to run even though the dataset is empty, instead of having information from a prior interval? Any suggestions would be helpful.
Thanks,
Dean
Without seeing how you are currently doing it is hard to make an informed suggestion.
In the old days we would just use a DATA _NULL_ step. For example if you were using PROC REPORT to make the report you could preceed with a data _null_ step.
ods pds file='step1.pdf';
data _null_;
if nobs=0 then do;
file print;
put 'No data for this report';
end;
stop;
set report1 nobs=nobs ;
run;
proc report data=report1 .......
............
ods pdf close ;
Let me see if I understand the problem.
You are generating the report to a file? And since the input is empty the step doesn't run so the file isn't overwritten?
Depends on how you are generating the reports, but in general you should add a step to write a dummy report before the one that makes the real report.
Then if the step doesn't overwrite it they get the dummy report instead of the report from the previous successful run.
Okay... that's makes sense. I am not familiar with how to create that kind of step. Is there a resource that you could recommend that would walk me through that process?
Without seeing how you are currently doing it is hard to make an informed suggestion.
In the old days we would just use a DATA _NULL_ step. For example if you were using PROC REPORT to make the report you could preceed with a data _null_ step.
ods pds file='step1.pdf';
data _null_;
if nobs=0 then do;
file print;
put 'No data for this report';
end;
stop;
set report1 nobs=nobs ;
run;
proc report data=report1 .......
............
ods pdf close ;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.