Programmatically place outq on hold when empty

5 pts.
Tags:
CL
OUTQ
Hi, I have been tasked with writing a CL program that will be run every night that releases a held Outq and allows the contents to go through then, put the outq back on hold once there are no more spool files in it. Is there an API or something I can use in a CL program that will check for an empty outq? Thanks,

Answer Wiki

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

Hi,

If you have a writer attached to your OUTQ you could just start the writer with :-

AUTOEND(*YES *NORDYF)

This should stop the writer as soon as there are no spooled files available.

Regards,

Martin Gilbert.

=====================================================

AUTOEND() can be useful, but might need additional programming depending on how print jobs are scheduled overnight. Batch jobs might run between 10 PM and midnight. The writer might be started to print those jobs. By 12:30, those will have printed and the writer ends. Backup jobs run for an hour or so, and then more print jobs run — but the writer must now be restarted.

That is, the writer must be restarted every time a new spooled file hits the queue during the night whenever the writer previously ended.

If the status of the output queue only needs to be tested during a particular time span, the List Spooled Files (QUSLSPL) API can be used to get a count of the number of spooled files on the queue. The API might be called in a loop after delays of 5, 10 or more minutes until zero files are found.

Tom

Discuss This Question:  

 
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

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