BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi, I'm new to using ods html, and I was wondering if someone could help me. The user enters a valid PROC SQL statement, and the dispatcher program takes it and display it to a html output page. Right now, when the SQL statement returns no result, the HTML output page is blank. How can I display a message on the HTML output page telling the users that no output returned from the query they requested, instead of having just a blank page?

Any help is appreciated. Thanks!
3 REPLIES 3
1162
Calcite | Level 5
Here's one suggestion.

Before starting your ods html statement, use a sql statement to count the number of records returned and pass that count into a macro variable. For example:

proc sql noprint;
select count(a) into :sqlcnt
from work.data;
quit;

Then I would add a title to my html report that goes something like:

title2 "Number of records returned: &sqlcnt";

When your SQL query returns no records, you'll still get the title that says no records returned.
David_SAS
SAS Employee
ODS tries not to generate output containing no output objects (tables, graphs, text) in the body of the document. I would expect the SQL job to produce no HTML output.

A slight modification should work. Instead of a TITLE statement, use an ODS HTML TEXT= statement.

-- David Kelley, SAS
Message was edited by: David@SAS at Mar 31, 2006 10:50 AM
Cynthia_sas
SAS Super FREQ
Are you by any chance using SAS/IntrNet and/or htmSQL??? I wondered because usually when you use the dispatcher program, you are using SAS/IntrNet. Generally, you can code something in your dispatcher program to return a message to _webout using data _null_ or ODS TEXT=. If you are using SAS/IntrNet, look at this example that displays a message when there is an invalid attempt to login:
http://support.sas.com/rnd/web/intrnet/dispatch/sesssamp.html
Cynthia

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 3 replies
  • 1342 views
  • 0 likes
  • 4 in conversation