Retrieving error incurred(if any) from the jobs using an independent process- AS/400

80 pts.
Tags:
AS/400 jobs
Batch jobs
Hi,

we have some batch jobs running for the entire day.Can someone tell me what will be the best way to monitor the errors that got spooled in a joblog & retrieve the same using an independent process ? If possible, please let me know the steps that  can be best suited to cover the most of the senarios. Can there be a case that job is active but in one procedure it incurred one error which got spooled to the log file.

Thanks in advance.....

 



Software/Hardware used:
As400

Answer Wiki

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

Hi,
Thanks for the reply…
Charlie – yeah it would have been better if they could included the exceptions handling in all but so many programmers have worked on it for years…

Tom- thanks again.I’ll give it a try.For QMHLJOBL API, can i retrieve the error log as u mentioned below no matter it is running in diff sbs & irrespective of their status?
For this job message queue, can u plz give a briff description as how should i know which message queue the job is referring to? Do i need to first get the list of jobs, then run RTVJOBD(or we donot need this?) against each job to get the msg queue & then follow your steps?

Regards,

Discuss This Question: 8  Replies

 
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
  • CharlieBrowne
    It would be nice to know a little more information. Why not monitor for the errors in the actual program and that way you can check for whatever specific contitions you desire and act according for each one. Another idea would be so send the error messages to QSYSOPR or some other message queue and have a program monitor that queue and do whatever action you need done. If you are just using a global MONMSG CPF0000 at the top of your program, you risk missing some critical errors. That is not usually a good programming technique to use.
    41,430 pointsBadges:
    report
  • TomLiotta
    ...what will be the best way to monitor the errors that got spooled in a joblog & retrieve the same using an independent process ? I don't think there is a best way. It shouldn't be done by an independent process. I'm only aware of one way with two alternatives. But I wouldn't call it the "best way". The List Job Log Messages (QMHLJOBL) API can list messages from a job's job message queue into a user space. An independent process could call the API repeatedly until all messages had been returned. After each block is returned, the independent process would loop through the user space looking for messages that indicated something needed to be done. When a block was finished and more messages are available, the API would be called again to get the next block. As an alternative, if you don't want to handle user spaces, you could call the Open List of Job Log Messages (QGYOLJBL) API and handle it as an 'open list'. Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    how should i know which message queue the job is referring to? It is the job message. It doesn't have a name. Every job has its own job message queue. The API retrieves the messages from the job message queue of the job name that you give to the API. It can only access the job message queue of a job that is active or on a job queue. The only message that it's likely to find for a job on a job queue is the request (*RQS) message for the job. Hmmm... I haven't tried, but it might also find messages for jobs that have their joblog in a pending state. It doesn't matter what subsystem is involved either way, as long as you have sufficient authority. Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    In any case, it's almost guaranteed that there are much better ways to get your problem solved. But we don't know what your problem is yet. You asked about a complex technical issue, but the problem seems to be relatively simple. Tom
    125,585 pointsBadges:
    report
  • 1607
    Hi, Let me explain my requirement...hope u all might be able to guide me in a proper direction that i sud go... All our jobs were scheduled thru a schedular.Some jobs run for entire day...Ideally speaking some jobs might go to some msgw status or some jobs might get dumped because of some error or some jobs might incurred some error but stil remain active .i dodn't know if i've missed any but i've seen all these scenarios in our system specially the last one where i have seen that a particular job remains active and is having a joblog with a SQL0501 state..cursor problem. Now one thing is that i need to built a process to monitor the jobs which can be scheduled to run every 10-15 minutes thru out the day... Hope i have clear my req... Regards,
    80 pointsBadges:
    report
  • 1607
    [...] 6. CharlieBrowne and TomLiotta helped out a user trying to retrieve the error incurred (if any) from AS/400 jobs using an independent process. [...]
    0 pointsBadges:
    report
  • Rr22
    What is the meaning of engines in job processing in AS/400?
    100 pointsBadges:
    report
  • TomLiotta
    What is the meaning of engines in job processing in AS/400? It's not clear how this relates to this thread. If this is an unrelated question, please open a new question so it can be given attention. Tom
    125,585 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