Help using Base SAS procedures

Can I get some default/emtpy text to display if a PROC REPORT is empty?

Reply
N/A
Posts: 0

Can I get some default/emtpy text to display if a PROC REPORT is empty?

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!
Super Contributor
Super Contributor
Posts: 3,174

Re: Can I get some default/emtpy text to display if a PROC REPORT is empty?

Posted in reply to deleted_user
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.
N/A
Posts: 0

Re: Can I get some default/emtpy text to display if a PROC REPORT is empty?

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 Smiley Wink Message was edited by: chucknelson
Ask a Question
Discussion stats
  • 2 replies
  • 335 views
  • 0 likes
  • 2 in conversation