How to suppress MLWTO message when the data tested is at the second line?

book

Article ID: 206834

calendar_today

Updated On:

Products

CA OPS/MVS Event Management & Automation

Issue/Introduction

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:

https://techdocs.broadcom.com/us/en/ca-mainframe-software/automation/ca-ops-mvs-event-management-and-automation/13-5/using/using-automated-operations-facility-aof-rules/coding-each-aof-rule-type/message-rules/initialization-processing-and-termination-sections-of-msg-rules.html#concept.dita_ee44ba3f67fadc0893c93f28f384a7f977b52dfd_ExecutionConsiderationsforMSGRules: 
 
If you are attempting to modify the route or descriptor codes of a multiline message, then this logic cannot be accomplished when specifying the MLWTO optional keyword. This is because the MLWTO keyword causes the rule to process after the end-line has been issued, and disposition alteration logic (change route or desc codes) must be performed at the time the primary line of the multiline message is issued.
 
So, how should we proceed in order to not send those messages to the console?  Do we need to hardcode the SUPPRESS on the )MSG xxxxxxxx MLWTO line?  Will that suppress all messages from the console without testing it in the code after?
 
 
 
 

Environment

Release : 14.0

Component : OPS/MVS

Resolution

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