How to Retrieve MSGW status in WRKACTJOB in CL variable

115 pts.
Tags:
CL
CL/400
MSGW status
WRKACTJOB
Hi, While Job monitoring if any job goes in MSGW status ... then is there any CL command which retrieves the status (exactly MSGW not *ACTIVE) and display it on the screen. Rather than doing manually job monitoring (Pressing F5 for a long time to look into the status of the job) if a CL can run which retrieves this status and display it.. If anyone can please help me on this.. I have tried a lot but not able to get this...
1

Answer Wiki

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

Hi,

You could try doing a RCVMSG from the QSYSOPR message queue.

Regards,

Martin Gilbert.

Discuss This Question: 11  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.
  • Cool400
    Hi Martin, Can you please elaborate your answer..
    115 pointsBadges:
    report
  • Gilly400
    Hi, You can write a small CL program which runs all the time waiting for a message in QSYSOPR (using RCVMSG). Depending on what sort of message is received your program can respond appropriately - for example it could send a break message to specific users (maybe operators), or could send an e-mail to you. You could code your program to ignore messages that you don't need to act upon. There are a lot of possibilities available. Another option is to add a monitor using ops navigator - I believe you can add a monitor which will only act upon jobs in message wait status. Try searching through the ITKE site, I'm sure this has been covered already. Regards, Martin Gilbert.
    23,730 pointsBadges:
    report
  • harisudhan21
    Hi , yes am using the Ops Navigator as well for the QSYSOPR message queue monitoring, as its very easy and once configured with the message descriptions its just triggers the alert window. There are many pdf's in the IBM sites for how to configure or maybe in the iSeries navigator help itself. Thanks Hari
    1,005 pointsBadges:
    report
  • Cool400
    Thanks for your answer,, It is absolutely working fine.... But to more extent what if I want to display a message only when a specific job which goes into MSGW...
    115 pointsBadges:
    report
  • Gilly400
    Hi, Whichever option you use (CL program with RCVMSG or Ops Navigator), you should be able to specify which job to check for. If you use the RCVMSG then the job name should be contained somewhere in the message - can't remember exactly where, it's been some time since I've done this. Regards, Martin Gilbert.
    23,730 pointsBadges:
    report
  • mandaueboi
    hi all, im new to AS400 and would like to ask if anyone can share CL program that would check msgw in work with active jobs and auto reply perhaps? 
    i plan to run this CL as a job.

    currently doing a manual checking and f5 refresh and reply to this msgw. thanks
    10 pointsBadges:
    report
  • azohawk
    Look at API QUSLJOB.  I have a program that uses this API to look for jobs with MSGW and LCKW status, notifies staff if jobs are found, ours also looks for job queues that are backing up (indication of a long running job).  We set ours to resubmit itself every 15 minutes during work hours and hourly during off hours (I don't need a message every 15 minutes if I am 3 hours from home).  Our code is written in RPG, But I think the same thing could be done in CL.   I modified code I found on CODE400.COM written by jamief and posted 7/18/2008.  The key things I modified had to do with the notifications (checking times, who to notify, notification message, etc.), checking for jobs in the jobq, and the self re-submitting function.
    4,055 pointsBadges:
    report
  • ToddN2000
    I think there are options in the System Service Tools (SST/DST) that will allow you to do this. Unfortunately I do not have access to that sign on any longer.
    135,295 pointsBadges:
    report
  • TheRealRaven
    @mandaueboi : Please clarify what you mean by "auto reply" relative to MSGW. That's not something that's easily done. Determining what to reply to takes some sophisticated code, not to mention determining what reply might be needed.

    Also, MSGW comes from at least two fairly different circumstances. Sending any "reply" at all in the wrong case can really mess up the waiting job. And the code to determine what the circumstances are is also fairly sophisticated.
    36,320 pointsBadges:
    report
  • ToddN2000
    True, like raven mentioned. You can have a MSGW when you have an async job that is running constantly waiting for input in a MSGQ in order to procede. You can also have a MSGW status when there is a hard job halt, with a CPF message possibly, waiting for a response from the user / operator.  
    135,295 pointsBadges:
    report
  • WoodEngineer
    For automatic replies check out IBM's system reply list feature (WRKRPYLE).  The reply list entry can check for a specific string starting at a specific place in the message.  If there is a match the reply in the reply list entry will be issued.  
    For example, we have reply list entries for CPA3394 (load forms).  If the message contains "AMACPR1" the system automatically issues a "G" and the printer continues running.  This is a general purpose printer which typically is loaded with plain paper so no problem.
    To use the system reply list in a submitted job specify INQMSGRPY(*SYSRPYL) on the SMBJOB command.
    The key to avoiding unintended consequences is to use the string matching feature on the reply list entry.
    8,225 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.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: