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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

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
  • 841 views
  • 0 likes
  • 4 in conversation