Long time viewer...first time poster.
I have written a CL program which monitors the process of an overnight job that spawns multiple batch jobs. It is for testing on our development system so we can run/simulate multiple days in a row. The purpose is to submit a new overnight job when the previous one is finished, and to know when it can do that. This was accomplished using APIs to 1) Retrieve a list of active batch jobs, and 2) Check if any active batch jobs has a specific library in it. This process works fine, except for when one of those spawned batch jobs goes into a MSGW state.
What I am looking to accomplish is the following:
1) When I am looking through the list of batch jobs (using the QUSLJOB API), I want to be able to see if any of the batch jobs I am looking for is sitting in a MSGW state. (I am using JOBI0100; I believe I need JOBI0200 for this information).
2) If a batch job is found in a MSGW state, I want to know what the Message ID is (e.g. CPF4131).
3) I then want to respond to the message, or perform some action before responding to the message. (While defaults could be established, since these are spawned jobs from the overnight job, I can't define an automatic response for the message since this could carry over into production.)
I believe 1) is not that difficult to get the MSGW info; I have found this through other postings...but 2) and 3) I am not sure how to get the information on.
All of what has been programmed to date has been done in CL; I am working to keep this all in a CL program without having to call another program to handle it. I've mostly had trouble finding anything that can provide this information, but I believe it won't be challenging to code this if I can be pointed in the direction of other APIs that could provide this information/functionality.
I have written a CL program which monitors the process of an overnight job that spawns multiple batch jobs. It is for testing on our development system so we can run/simulate multiple days in a row. The purpose is to submit a new overnight job when the previous one is finished, and to know when it can do that. This was accomplished using APIs to 1) Retrieve a list of active batch jobs, and 2) Check if any active batch jobs has a specific library in it. This process works fine, except for when one of those spawned batch jobs goes into a MSGW state.
What I am looking to accomplish is the following:
1) When I am looking through the list of batch jobs (using the QUSLJOB API), I want to be able to see if any of the batch jobs I am looking for is sitting in a MSGW state. (I am using JOBI0100; I believe I need JOBI0200 for this information).
2) If a batch job is found in a MSGW state, I want to know what the Message ID is (e.g. CPF4131).
3) I then want to respond to the message, or perform some action before responding to the message. (While defaults could be established, since these are spawned jobs from the overnight job, I can't define an automatic response for the message since this could carry over into production.)
I believe 1) is not that difficult to get the MSGW info; I have found this through other postings...but 2) and 3) I am not sure how to get the information on.
All of what has been programmed to date has been done in CL; I am working to keep this all in a CL program without having to call another program to handle it. I've mostly had trouble finding anything that can provide this information, but I believe it won't be challenging to code this if I can be pointed in the direction of other APIs that could provide this information/functionality.
Comment