5,555 pts.
 Rretrieve date, time a job held
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.

Software/Hardware used:
ASKED: May 5, 2008  11:59 PM
UPDATED: April 21, 2010  6:12 AM

Answer Wiki:
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  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:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

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.

 5,555 pts.