trapping an empty dataset on strqmqry

75 pts.
Tags:
MONMSG
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?

Answer Wiki

Thanks. We'll let you know when a new response is added.

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.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • matis
    I actually used rtvmbrd to determine number of records and trapped qwm2204, 2701 & 1102 to allow the submitted job to end normally.
    75 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following