BookmarkSubscribeRSS Feed
AndyJ_
Calcite | Level 5

I have a SQL query pulling data from DB2 and then using ODS HTML to email the results table to an email user (myself for right now). Sometimes the result of the query has zero observations. For instances when I do not have any observations I would like to skip the ODS HTML portion of the job to prevent sending a blank email. I have looked and have been unable to find any examples I could use of an observation count stopping the processing of the job. Is there an easy way to do this?

Thanks,

Andy

2 REPLIES 2
PGStats
Opal | Level 21

Automatic macro variable SQLOBS is set to the observation count after every SQL query. Use it's value to send your email conditionnaly.

PG

PG
Reeza
Super User

It's generally macro logic

Here's a couple of questions that are related:

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 2 replies
  • 670 views
  • 6 likes
  • 3 in conversation