We have a message rule that we don't want the message to be on the console because it's generating tons of messages. The message is on 3 lines and the element to check is on the second line. After we do the tests, we want to suppress the message from the console and keep it on the syslog.
According to the documentation, the RETURN SUPRESS only works on the first line:
Release : 14.0
Component : OPS/MVS
The "SUPPRESS" keyword using in conjunction with the "MLWTO" keyword will suppress the message unconditionally. I suggest that you include code in your rule to re-issue the message if the conditions you are looking for don't match.
You have to use a different message id to avoid a loop but you can use some code like the sample below:
reissue:
do i = 1 to msg.text.0
newtext.i = msg.text.i
end
ADDRESS WTO "TEXTVAR('"newtext."') MSGID(REISSUED)"
So, if the logic of your rule doesn't go to any of the "return"s you have in the code eventually you should just reissue the message.
Complete sample rule:
)MSG XXXXXXX MLWTO SUPPRESS <- Suppress all messages
)PROC
if pos('XXXX',msg.text.2) > 0 then return <- if text is found then just suppress
/* otherwise, re-issue the message with a different message id */
reissue:
do i = 1 to msg.text.0
newtext.i = msg.text.i
end
ADDRESS WTO "TEXTVAR('"newtext."') MSGID(REISSUED)"
return