5 pts.
 Programmatically place outq on hold when empty
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,

Software/Hardware used:
ASKED: May 2, 2008  2:08 PM
UPDATED: April 20, 2010  6:56 AM

Answer Wiki:
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 <a href="http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/apis/QUSLSPL.htm">List Spooled Files (QUSLSPL) API</a> 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
Last Wiki Answer Submitted:  April 20, 2010  6:56 am  by  Gilly400   23,625 pts.
All Answer Wiki Contributors:  Gilly400   23,625 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


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