10 pts.
 MSGW in WRKACTJOB
How to end a job in MSGW how we can give in a program all the proces to give OPT-7 in front of a job which is in MSGW & giving 'G' to end that in RPGLE /CLLE progrm that too in a scheduled time

Software/Hardware used:
ASKED: January 5, 2009  5:46 AM
UPDATED: May 3, 2012  8:35 PM

Answer Wiki:
I dont know a way using wrkactjob however you can monitor for messages inside cl very easily or if using ile rpg you can use the monitor op code to catch any error while adding or updating a file
Last Wiki Answer Submitted:  January 6, 2009  12:57 pm  by  Markpg   155 pts.
All Answer Wiki Contributors:  Markpg   155 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Do you want your programming to handle every job that might go into MSGW status? or do you want to monitor only specific jobs for which you already understand the MSGW status?

MSGW status can arise in two very different ways. If you want to respond to *INQUIRY messages that the job has sent and is waiting on a reply, that’s one of the ways that cause MSGW. That seems to be what you’re looking for.

However, you can’t simply watch for MSGW status on every job and run the same procedure unless you know ahead of time which jobs to ignore. If you don’t know which ones to ignore, you need to extract some info from the job to see what kind of MSGW is happening. A job that is monitoring a message queue for example will also be in MSGW. And I’m pretty sure you don’t want to mess with those.

So, are you intending to stick with the specific scenario where you know the names of the jobs you’ll monitor? Or are you looking for a generic procedure that handle all kinds of MSGW in any future job?

They are very different procedures with different complexity.

Tom

 108,240 pts.

 

Previous member makes best suggestion.

However you can also create system reply list entries via the WRKRPYLE command and supply default replies to specific message identifiers. You can then change the INQMSGRPY parameter of the submitting job description from *RQD to *SYSRPYL and the system will automatically insert the default reply to the message you defined via the WRKRPYLE command. You can also supply the INqMSGRPY parameter on the SBMJOB command instead of changing the job description.

Be cautuious when using reply iist entries as they will be applied to any/all jobs using the *SYSRPYL parameter on job descriptions or submit job commands overrriding the default value.

Best practice is to provide job specific comparison data to the reply list entry you create if you don’t want the custom supplied reply to be inadvertantly utilized by other jobs using the *SYSRPYL parameter.

 25 pts.

 

Tom, I want my program to handle every job that might go into MSGW status. How to proceed?

 1,975 pts.

 

…I want my program to handle every job that might go into MSGW status.

Please describe what you want to happen when you “handle” the jobs.

There can be jobs that you cannot and should not “handle”. If a job’s normal state is supposed to be MSGW, what do you expect to do about it?

Tom

 108,240 pts.