First of all, if the user does NOT get the report will they start to
question the reliability of the email system? Or perhaps their own sanity
(did I accidentally delete that email?)?
Second, what do they do with the email? Do they key it into something
else? Would it be better to automatically process that? Or, if they have
to massage the numbers in a spreadsheet first, send them a spreadsheet?
This way, if you avoid a utility that does SQL2XLS kind of stuff you can
process that yourself to not send it on if there were no rows returned.
Running it twice, is an option with the first time to an output file and
then checking the number of rows in that. However, if it's processing
16M+ rows running it twice can be a performance dog. If it normally only
selects a few rows (if any) then instead of running it twice I'd run the
final query from the temporary file that you used to count rows instead of
the original file. Understand?
I couldn't find anything in the joblog that says "x rows returned" after
using RUNQRY. I even tried to go gonzo on it with:
CHGJOB LOG(4 00 *SECLVL) LOGCLPGM(*YES)
RUNQRY QRYFILE((ROB/AAAkey ))
Query options retrieved file QAQQINI in library QUSRSYS.
All access paths were considered for file AAAKEY.
Arrival sequence access was used for file AAAKEY.
**** Starting optimizer debug message for query .
**** Ending debug message for query .
Debug will catch more of these "Information" messages.
This thread ...
RE: Prevent spoolfiles generated via wrkqry from being auto emailed if "No records in query report. ", (continued)
This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact