BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi all,

I have a SAS program that loops through certain sets of data and generates a bunch of reports to an ODS HTML destination.

Sometimes, due to small sets of data I run these reports for, a certain PROC REPORT will not generate because, for this set of data I'm on, there is no data to report. I get this message for those instances:

WARNING: A GROUP, ORDER, or ACROSS variable is missing on every observation.

What I want in the HTML is to display some sort of message for these like "did not generate" or something.

I tried to use return/error codes or the warning text above to detect this, but the error code is 0 (no problem, really?) and the warning text doesn't reset if the next PROC REPORT generates OK.

If it is of any importance, I'm using a data step with CALL EXECUTE to get all this PROC REPORT code generated for these sets of data.

Is there any way to generate this "did not generate" message or at least to catch these warnings per PROC REPORT?

Thanks for any help!
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
You can conditionally execute a different CALL EXECUTE for a stub program that generates a DATA _NULL_; step with a simple "flower-box" message stating that there is no data today. You will need to use the NOBS= parameter on your SET statement (if using a WHERE stmt, not an IF /THEN DELETE). And, if you are testing for missing values or some minimal condition before generating the CALL EXECUTE, you will need to "count" to determine if you meet the criteria and if not then generate the CALL EXECUTE to output a stub informational report with the DATA _NULL_; step.

Scott Barry
SBBWorks, Inc.
deleted_user
Not applicable
Thanks Scott- yep, I think a conditional CALL EXECUTE and using a DATA _NULL_ step to check for valid report data is going to work fine. I think I was looking for some magical PROC REPORT option that doesn't exist ;) Message was edited by: chucknelson

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1093 views
  • 0 likes
  • 2 in conversation