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.