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-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!

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.

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
  • 2 replies
  • 874 views
  • 0 likes
  • 2 in conversation