Topic
  • No replies
spiceman2
spiceman2
1 Post

Pinned topic Can AMQ messages be monitored via MONMSG in an iSeries CL program

‏2017-07-27T22:09:01Z | *pgm cl websphere amq as400 iseries monmsg mq

I have a compiled CL program that executes an MQ control command using
   CALL PGM(QCMDEXC) PARM(&CMDSTR &CMDLEN)
If there is a problem with an MQ control command param, I want to catch the error msg
using the CL command MONMSG MSGID(xxx). Testing shows that msg ID
CPF0006 (command failed) or any other CPF code can be monitored and caught,
but AMQ msg ID's, such as AMQ8168 (User profile name not found), can not.
One web doc I found "Using MQSeries on the AS/400" [1] has a CL program
example to stop a qmgr example showing this line
    MONMSG MSGID(AMQ6906) EXEC(GOTO CMDLBL(LOOP))
that purports to monitor an AMQ message.

Here's an exact sample extract from my CL program:

  MONMSG MSGID(AMQ8168) +                         
       EXEC(SNDPGMMSG MSGID(AMQ8168) MSGF(AMQMSG) MSGTYPE(*ESCAPE) +
       MSGDTA('User profile name not found RC(AMQ8168)'))

I'm aware that MSGDATA example should have param values to fill in to the actual AMQ msg template,
but the syntax is correct, it compiles ok, but the AMQ msg, though seen in the calling application's
job log, is not caught in the CL program.

Anyone have related experience and the answer?
Is there a CL trick that I'm unaware of?

Any newer references with the answer?
Thanks.

[1] http://www.astradyne.net/manuals/ir028420.pdf
     
July 1998, pg. 209
    
 

Updated on 2017-07-27T22:10:28Z at 2017-07-27T22:10:28Z by spiceman2