The SAS Output Delivery System and reporting techniques

ODS html

Reply
N/A
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

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.
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
SAS Super FREQ
Posts: 8,743

Re: ODS html

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
Ask a Question
Discussion stats
  • 3 replies
  • 165 views
  • 0 likes
  • 4 in conversation