Is there a way to programmatically retrieve the date and time a job was held? I've checked RTVJOBA and a variety of job-related API's but find nothing.
Hi,
You can probably get this from the joblog. Not a very nice way to do it, but you could do a DSPJOBLOG to an output file and read the output file to retrieve the date and time. You should be able to look for MSGID = CPC1162
You should also be able to find the same information in the QSYSOPR message queue and the QHST logs.
Regards,
Martin Gilbert.
===========================================================
The Job Status API returns status *ACTIVE because the job is indeed active. Also, the JOBI0200 format of the <a href="http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/apis/qusrjobi.htm">Retrieve Job Information (QUSRJOBI) API</a> returns 'Active Job Status' which should be "HLD" when a job is held. This is what shows on the WRKACTJOB (Work with <i>Active </i>Jobs) display. (Note that active jobs that are held still show on WRKACTJOB.)
The <a href="http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/apis/QMHLJOBL.htm">List Job Log Messages (QMHLJOBL) API</a> would be used to find all of the held/released dates and times for an active job. Since a job may be held/released a practically unlimited number of times, there's no meaningful way for an API to return the specific information. As long as the joblog API already does the task, a dedicated API is overkill.
Tom
Last Wiki Answer Submitted: April 21, 2010 6:12 am by Gilly40023,625 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
Thank you, Gilly. I’ve finally come to the same conclusion you recommend. Sure was surprised to find this data is not available via an API. I was also surprised to learn that the job status API returns a job status of *Active even when a job is held.
Thank you, Gilly. I’ve finally come to the same conclusion you recommend. Sure was surprised to find this data is not available via an API. I was also surprised to learn that the job status API returns a job status of *Active even when a job is held.