75 pts.
 trapping an empty dataset on strqmqry
I used strqmqry to select records from a database file. i provide selection criteria. sometimes the query returns with no records. if no records are returned i want to bypass the display and end the program. if records are returned i want to bypass any display and call another program. how can i do this without creating an outfile and testing whether the file has any records?

Software/Hardware used:
ASKED: July 23, 2009  3:54 PM
UPDATED: July 24, 2009  6:52 PM

Answer Wiki:
STRQMQRY has only the following options - you can display the results on your wrkstn (if run interactively), print the results or write output to a file. I would recomment creating a file in QTEMP. This way you can get rid of the file after your job ends. As for no,of records, you can use the QUSRMBRD API to retrieve the info. Hope this helps.
Last Wiki Answer Submitted:  July 24, 2009  5:53 pm  by  Satsho   1,245 pts.
All Answer Wiki Contributors:  Satsho   1,245 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

I actually used rtvmbrd to determine number of records and trapped qwm2204, 2701 & 1102 to allow the submitted job to end normally.

 75 pts.