The SAS Output Delivery System and reporting techniques

ODS html

Not applicable
Posts: 0

ODS html

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!
Frequent Contributor
Posts: 95

Re: ODS html

Posted in reply to deleted_user
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

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.
SAS Employee
Posts: 174

Re: ODS html

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
Posts: 9,371

Re: ODS html

Posted in reply to deleted_user
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:
Ask a Question
Discussion stats
  • 3 replies
  • 4 in conversation