Rretrieve date, time a job held

6875 pts.
Tags:
AS/400
Job Management
RTVJOBA
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.

Answer Wiki

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

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 Retrieve Job Information (QUSRJOBI) API returns ‘Active Job Status’ which should be “HLD” when a job is held. This is what shows on the WRKACTJOB (Work with Active Jobs) display. (Note that active jobs that are held still show on WRKACTJOB.)

The List Job Log Messages (QMHLJOBL) API 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

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
  • WoodEngineer
    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.
    6,875 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