BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
D_Z_
Obsidian | Level 7

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

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

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 ;

View solution in original post

3 REPLIES 3
Tom
Super User Tom
Super User

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.

D_Z_
Obsidian | Level 7

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?

Tom
Super User Tom
Super User

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 ;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 2430 views
  • 0 likes
  • 2 in conversation