On 8/12/2015 3:38 PM, Jeff Young wrote:
What I do when I need to know if my query produced results first before
taking any other action is to run the query directed to an output file in
qtemp, then retrieve the number of current records in that file. If the
value is ZERO, I have no data and skip the rest of my processing.
We have similar things going on here. We'd write a query because it was
faster than writing a program. Then we had to do something special to
format it. Then we had to do another special thing to send it. Then
another special thing to avoid sending it if it was empty.
It turned into a lot of work in order to save ourselves the work of
writing a program. I guess in the end it was OK because the work was
spread out over time...
Today, I'd argue for a proper program that does the extract, formatting,
and if there's something to be sent, do the emailing.