Example 2: Creating a non-MQFMT_EVENT message Rule for IBM MQ message


To create a Rule that fires when a IBM MQ message is written to the PROD.AP.QUEUE queue with a message text of CLOSE ALL, follow these steps:

  1. From the Automation Control panel, type the E line command, for (E)nable, and press Enter to enable the Rule Set you want to add the Rule to. You can add Rules only to enabled Rule Sets.

    Figure 1. Creating a Rule for a message with format MQFMT_STRING: Automation Control panel

    BMC Software -------------- Automation Control ------------- AutoOPERATOR
    COMMAND ===>                                                 TGT ===> SYSE
    Primary commands: Add                                        DATE --- YY/MM/DD
                                                                 TIME --- 14:14:39
    Automation Status     ===> ACTIVE         (Active, Inactive)
    Automation Strategy   ===> INDIVIDUAL     (Individual, All, First, Qualified)
    Honor MPF Suppression ===> NO             (NO/YES)
                            Automation Statistics
      Total Events              48,538   Display suppressed             67
      Events Handled            22,407   Hardcopy suppressed             0
      Current arrival rate    2  / sec   Rule generated Alerts      22,223
      Peak arrival rate      99  / sec   Rule invoked EXECs            276
                             Automation Library
    LC CMDS --- (S)elect, (E)nable, (D)isable, (T)est, (SA)ve
                (M)ove, (B)efore or (A)fter, (F)ilter Criteria
    LC   Rule-Set Status   Rules     Fired  Filtered    Date      Time   Strategy
    ___  AAORUL00 ENABLED     15    22,223    48,573  YY/MM/DD 08:18:59 FIRST
    ___  AAORULBC ENABLED     54       188    48,573  YY/MM/DD 08:18:59 FIRST
    ___  AAORULCM ENABLED     52        59    48,573  YY/MM/DD 08:18:59 FIRST
    ___  RULCICS  ENABLED     25         1    48,573  YY/MM/DD 08:19:00 FIRST
    e_   RULMQS01 DISABLED     8         0        38  YY/MM/DD 14:14:38 FIRST
              *********************** END OF DATA ***********************
  2. To select the Rule Set, type the S line command, for (S)elect, in the LC field next to the Rule Set name and press Enter.

    Figure 2. Creating a Rule for a message with format MQFMT_STRING: Automation Control panel

    BMC Software -------------- Automation Control ------------ RULMQS01 ENABLED
    COMMAND ===>                                                 TGT ===> SYSE
    Primary commands:                                            DATE --- YY/MM/DD
                                                                 TIME --- 08:35:54
    Automation Status     ===> ACTIVE         (Active, Inactive)
    Automation Strategy   ===> INDIVIDUAL     (Individual, All, First, Qualified)
    Honor MPF Suppression ===> NO             (NO/YES)
                            Automation Statistics
      Total Events              48,538   Display suppressed             67
      Events Handled            22,407   Hardcopy suppressed             0
      Current arrival rate    2  / sec   Rule generated Alerts      22,223
      Peak arrival rate      99  / sec   Rule invoked EXECs            276
                             Automation Library
    LC CMDS --- (S)elect, (E)nable, (D)isable, (T)est, (SA)ve
                (M)ove, (B)efore or (A)fter, (F)ilter Criteria
    LC   Rule-Set Status   Rules     Fired  Filtered    Date      Time   Strategy
    ___  AAORUL00 ENABLED     15    22,223    48,573  YY/MM/DD 08:18:59 FIRST
    ___  AAORULBC ENABLED     54       188    48,573  YY/MM/DD 08:18:59 FIRST
    ___  AAORULCM ENABLED     52        59    48,573  YY/MM/DD 08:18:59 FIRST
    ___  RULCICS  ENABLED     25         1    48,573  YY/MM/DD 08:19:00 FIRST
    s__  RULMQS01 ENABLED     8         0        38   YY/MM/DD 14:14:38 FIRST
              *********************** END OF DATA ***********************

    The Rule Set Overview panel is displayed. The figure below shows an example of a Rule Set named RULMQS01 and the Rules it contains.

  3. To add a new Rule, use the ADD primary command on the COMMAND line.

    Figure 3. Creating a Rule for a message with format MQFMT_STRING: Rule Set Overview panel

    BMC Software  ----------------- Rule Set Overview ---------------- AutoOPERATOR
    COMMAND ===> add                                            TGT  --- SYSE     
    Rule Set ID: RULMQS01    Ruleset Strategy ===> ALL          DATE --- YY/MM/DD
    Primary commands: Add, Save, Sort, Unsort, Reset, Filter    TIME --- 09:34:54
    LC CMDS --- (S)elect, (E)nable, (D)isable, (T)est, (DE)lete, (I)nsert          
                (C)opy/(CC)opy, (M)ove/(MM)ove, (B)efore or (A)fter, (R)epeat      
    Sort Criterion:                                                   right/left   
                                                                                  
    LC  Rule-id Stat Text-id          Type   Fired EXEC        Changed      ID     
        ________ _   ________________ ____         ________ ________ _____ ________
    ___ MQQDPLOW ENA Q_DEPTH_LOW      MQS        0 MQVARS 1 YY/MM/DD 15:56 BAOJDB4
    ___ MQQDPLO2 ENA Q_DEPTH_LOW      MQS        0 MQVARS 2 YY/MM/DD 15:56 BAOJDB4
    ___ MQSVINTH ENA Q_SERVICE_INTERV MQS        0 MQVARS 1 YY/MM/DD 15:56 BAOJDB4
    ___ MQSVINT2 ENA Q_SERVICE_INTERV MQS        0 MQVARS 2 YY/MM/DD 15:56 BAOJDB4
    ___ MQSVINOK ENA Q_SERVICE_INTERV MQS        0 MQVARS 1 YY/MM/DD 15:56 BAOJDB4
    ___ MQSVINO2 ENA Q_SERVICE_INTERV MQS        0 MQVARS 2 YY/MM/DD 15:56 BAOJDB4
    ___ MQPUTENA ENA PUT_INHIBITED    MQS        0 MQVER MQ YY/MM/DD 14:51 JDB3    
    ___ MQPUTEN2 SUS PUT_INHIBITED    MQS        0 MQVER MQ YY/MM/DD 14:51 JDB3    
    ___ MQQFULL  ENA Q_FULL           MQS        0 MQVER MQ YY/MM/DD 20:49 JDB3    
    ___ QUEUE1   ENA                  MQS        0 VARDISP  YY/MM/DD 15:56 BAOJDB4
    ___ APQHI    ENA Q_DEPTH_HIGH     MQS        0          YY/MM/DD 18:32 BAOJDB4
           ************************* END OF DATA **************************

    The Rule Processor Detail Control panel is displayed.

    Figure 4. Creating a Rule for a message with format MQFMT_STRING: Rule Processor Detail Control panel

    BMC Software ---------- Rule Processor Detail Control --------- AutoOPERATOR
     COMMAND ===>                                                 TGT  --- SYSE
                                                                  TIME --- 09:35:54
       The following options are displayed in sequence, or may    DATE --- YY/MM/DD
       be selected by entering the two-character code

        S1 - Selection Criteria            AV - Set Variable(s)                     
        SV - Variable Dependencies         AA - Alert Action(s) I                   
        A1 - Action Specification(s) I     AD - Alert Action(s) II                  
        A2 - Action Specification(s) II                                             
     Rule ID       ===>
     Event Type    ===>          Type  of event ( ? for list)
     Initial Mode  ===>          (ENABLED/DISABLED/TEST)

     Criteria match rate:
     If matched    ===>          (Maximum # times matched within INTERVAL, 1-100)
     in seconds    ===>          (Interval length, 1-99999 seconds)
     then status   ===>          (SUSPEND, DISABLE)

     Application information:
     Group         ===>          Function      ===>          Code   ===>
     Author        ===>          Description   ===>
     Last Modified by          on          at
       Press ENTER to continue, END to apply changes, CANCEL to cancel changes
  4. Type the following information:

    • A unique Rule ID in the Rule ID field (for example, CLOSAP
    • MQS in the Event Type field
    Warning

    Note

    The Event Type MQS will be accepted only if the MainView AutoOPERATOR for MQ key is present. If the key is not present, you receive a short error message in the upper right corner of the panel.

    Figure 5. Creating a Rule for a message with format MQFMT_STRING: Rule Processor Detail Control panel

     BMC Software ----------Rule Processor Detail Control --------- AutoOPERATOR
     COMMAND ===>                                                 TGT  --- SYSE
                                                                  TIME --- 15:46:37
       The following options are displayed in sequence, or may    DATE --- YY/MM/DD
       be selected by entering the two-character code

        S1 - Selection Criteria            AV - Set Variable(s)                     
        SV - Variable Dependencies         AA - Alert Action(s) I                   
        A1 - Action Specification(s) I     AD - Alert Action(s) II                  
        A2 - Action Specification(s) II                    
                            
     Rule ID       ===> CLOSAP
     Event Type    ===> MQS       Type  of event (? for list)
     Initial Mode  ===> ENABLED  (ENABLED/DISABLED/TEST)

     Criteria match rate:
     If matched    ===>          (Maximum # times matched within INTERVAL, 1-100)
     in seconds    ===>          (Interval length, 1-99999 seconds)
     then status   ===>          (SUSPEND, DISABLE)

     Application information:
     Group         ===>        Function      ===>             Code   ===>
     Author        ===>        Description   ===>
     Last Modified by          on          at
       Press ENTER to continue, END to apply changes, CANCEL to cancel changes
  5. Press Enter: the Selection Criteria - MQS panel is displayed:

    Figure 6. Creating a Rule for a message with format MQFMT_STRING: Selection Criteria - MQS panel

    BMC Software  ------------- Selection Criteria - MQS  ------------ AutoOPERATOR
    COMMAND ===>                                                 TGT  --- SYSE     
                                                                                 
           Rule-set === RULMQS01             Rule-id  === CLOSAP                   
                                                                                  
    Queue Identification:                              (1 to 12 Queue Managers)    
    Manager(s)   ===>                                                             
    Queue Id     ===>                                                              
                                                                                  
    Message Identification:                                                        
    Format       ===>                                  (Value from MD Format field)
    Event Type   ===>                                  (Enter ? for help)          
                                                                                  
                      Sub   Len  Op   Value                                        
    Msgid        ===> ___ : ___ __  ____________________________________________
    CorrelId     ===> ___ : ___ __  ____________________________________________
    Msg Buffer   ===> ___ : ___ __  ____________________________________________
                                    ___________________                          
                                                                                  
                                                                                  
    Press ENTER to continue, END return to Detail Control, CANCEL to cancel changes
  6. Enter the selection criteria for this event:
    1. In the Manager(s) field, enter the name of your queue manager (for example,CSQ1).
    2. In the Queue ID field, type PROD.AP.QUEUE. This is the name of the queue where this message must originate.
    3. In the Format field, type MQFMT_STRING.This is the message format. When you create Rules for IBM MQ messages with a format other than MQFMT_EVENT, use the fields MsgId, CorrelId and Msg Buffer to add additional selection criteria, if required.
    4. In the Msg Buffer field, type CLOSE ALL.The message must match this text.

      Warning

      Note

      Be aware that the variable IMFTEXT, which is passed to an EXEC when scheduled from a Rule, has the same limitations (255 bytes) as the MSG Buffer of the Selection Criteria Panel. For more information regarding IMFTEXT, see Chapter 4 in the MainView AutoOPERATOR Advanced Automation Guide. To access data in the message beyond 255 bytes, you must use an EXEC. By using a CLIST, you can access up to 32,767 bytes of the message cont ent and you can access 16 MB (minus 48 bytes for the message header) of the message content by using a REXX EXEC.

      Figure 7. Selection Criteria - MQS panel

      BMC Software  ------------- Selection Criteria - MQS  ------------ AutoOPERATOR
      COMMAND ===>                                                 TGT  --- SYSE     
                                                                                   
             Rule-set === RULMQS01             Rule-id  === CLOSAP                   
                                                                                    
      Queue Identification:                             (1 to 12 Queue Managers)    
      Manager(s)   ===> CSQ1                                                         
      Queue Id     ===> PROD.AP.QUEUE                                               
                                                                                    
      Message Identification:                                                        
      Format       ===> MQFMT_STRING                   (Value from MD Format field)
      Event Type   ===>                                  (Enter ? for help)          
                                                                                    
                        Sub   Len  Op   Value                                        
      Msgid        ===> ____ : ___ __  _____________________________________________
      CorrelId     ===> ___  : ___ __  ______________________________________________
      Msg Buffer   ===> ___  : ___ __  CLOSE ALL ___________________________________
                                       ___________________                          
                                                                                    
                                                                                    
      Press ENTER to continue, END return to Detail Control, CANCEL to cancel changes
  7. Press Enter: the Variable Dependencies - MQS panel is displayed.

     

    BMC Software ----------- Variable Dependencies - MQS ----------- AutoOPERATOR
    COMMAND ===>                                                 TGT ---  SYSE
           Rule-Set === RULMQS01             Rule-ID  === CLOSAP
                                                                               OR/
     Variable-name                    Op  Variable-Value                      AND
     ________________________________ __  ___________________________________  ___
     ________________________________ __  ___________________________________  ___
     ________________________________ __  ___________________________________  ___
     ________________________________ __  ___________________________________  ___
     ________________________________ __  ___________________________________  ___
     ________________________________ __  ___________________________________  ___
     ________________________________ __  ___________________________________  ___
     ________________________________ __  ___________________________________  ___
     ________________________________ __  ___________________________________  ___
     ________________________________ __  ___________________________________  ___
     ________________________________ __  ___________________________________  ___
     ________________________________ __  ___________________________________  ___
     ________________________________ __  ___________________________________  ___
    Press ENTER to continue, END return to Detail Control, CANCEL to cancel changes
  8. This example does not use variable dependencies; press Enter.The Action Specification(s) I - MQS panel is displayed.

    Figure 8. Creating a Rule for a message with format MQFMT_STRING: Action Specification(s) I - MQS panel

    BMC Software  ---------- Action Specification(s) I - MQS  -------- AutoOPERATOR
     COMMAND ===>                                                 TGT  --- JB71     
            Rule-set === RULMQS01             Rule-id  === CLOSAP                    
                                                                                   
     Automation Actions:                                                            
     Journal          ===>                                                          
                                                                                   
     * Exec Name/Parms ==>                                                          
                                                                                   
     * Cmd(Type MQ  ) ===>                                                          
                                                                                   
     * Issue Msg( WTO ) =>                                                          
                                                                                   
     POST Target      ===>                                                          
     POST ID          ===>                                                          
     POST Parms       ===>                                                          
                                                                                   
            MQ Automation Actions:                                               
     Keep Message     ===> YES    (Yes or NO)   Remove DLH  ===>       (Yes or No)  
     Destination Que  ===>                                                          
     Destination QMgr ===>                                                          
     * Enter a question mark(?) and blank in any field on the line for more options.
     Press ENTER to continue, END return to Detail Control, CANCEL to cancel changes
  9. Use the Action Specification(s) I - MQS panel to specify the action for the Rule to take when it fires.For this example, the two actions that this example Rule takes are to start a Started Task named APCLOSE and to delete the message from the queue.

    To specify the actions for this Rule:

    1. Change Cmd(Type MQ) to Cmd (Type MVS) and type #S APCLOSE in the Cmd field.
    2. Type NO in the Keep Message field, which deletes the original message.

      Figure 9. Action Specification(s) I - MQS Panel

      BMC Software  ---------- Action Specification(s) I - MQS  -------- AutoOPERATOR
       COMMAND ===>                                                 TGT  --- JB71     
              Rule-set === RULMQS01             Rule-id  === CLOSAP                    
                                                                                     
       Automation Actions:                                                            
       Journal          ===>                                                          
                                                                                     
       * Exec Name/Parms ==>                                                          
                                                                                     
       * Cmd(Type MQ  ) ===> #S APCLOSE                                                          
                                                                                     
       * Issue Msg( WTO ) =>                                                          
                                                                                     
       POST Target      ===>                                                          
       POST ID          ===>                                                          
       POST Parms       ===>                                                          
                                                                                     
                MQ Automation Actions:                                               
       Keep Message     ===> NO    (Yes or NO)   Remove DLH  ===>       (Yes or No)  
       Destination Que  ===>                                                          
       Destination QMgr ===>                                                          
       * Enter a question mark(?) and blank in any field on the line for more options.
       Press ENTER to continue, END return to Detail Control, CANCEL to cancel changes
  10. Press Enter until the Rule Processor Detail Control panel is redisplayed.This example Rule does not require that you enter any additional information on the following panels that are bypassed by pressing Enter:

    • Action Specification(s) II - MQS
    • Action: Set Variables - MQS
    • Alert Action(s) I - MQS
    • Alert Action(s) II - MQS

    The Rule Processor Detail Control Panel is redisplayed.

    Figure 10. Creating a Rule for a message with format MQFMT_STRING: Rule Processor Detail Control panel

    BMC Software  ------------ Rule Processor Detail Control --------- AutoOPERATOR
    COMMAND ===>                                                 TGT  --- SYSE     
                                                                 TIME --- 15:23:36
      The following options are displayed in sequence, or may    DATE --- YY/MM/DD
      be selected by entering the two-character code                               
                                                                                 
       S1 - Selection Criteria            AA - Alert Action(s) I                   
       SV - Variable Dependencies         AD - Alert Action(s) II                  
       A1 - Action Specification(s) I     BA - Impact Integration for z/OS Action  
       A2 - Action Specification(s) II                                             
    Rule ID       ===> CLOSAP                                                      
    Event Type    ===> MQS      Type  of event ( ? for list)                       
    Initial Mode  ===> ENABLED  (ENABLED/DISABLED/TEST)                            
                                                                                  
    Criteria match rate:                                                           
    If matched    ===>          (Maximum # times matched within INTERVAL, 1-100)   
    in seconds    ===>          (Interval length, 1-99999 seconds)                 
    then status   ===>          (SUSPEND, DISABLE)                                 
                                                                                  
    Application information:                                                       
    Group         ===>          Function      ===>          Code   ===>            
    Author        ===> BAOJDB4  Description   ===>                                 
    Last Modified by          on          at                                     
       Press ENTER to continue, END to apply changes, CANCEL to cancel changes
  11. Press PF3 to apply the changes.The Rule Set Overview Panel is redisplayed:

    Figure 11. Rule Set Overview panel

    BMC Software  ----------------- Rule Set Overview ---------------- RULE UPDATED
    COMMAND ===>                                                 TGT  --- SYSE     
    Rule Set ID: RULMQS01    Ruleset Strategy ===> ALL           DATE --- YY/MM/DD
    Primary commands: Add, Save, Sort, Unsort, Reset, Filter     TIME --- 16:06:12
    LC CMDS --- (S)elect, (E)nable, (D)isable, (T)est, (DE)lete, (I)nsert          
                (C)opy/(CC)opy, (M)ove/(MM)ove, (B)efore or (A)fter, (R)epeat      
    Sort Criterion:                                                   right/left   
                                                                                  
    LC  Rule-id Stat Text-id          Type   Fired EXEC        Changed      ID     
        ________ _   ________________ ____         ________ ________ _____ ________
    ___ MQQDPLOW ENA Q_DEPTH_LOW      MQS        0 MQVARS 1 YY/MM/DD 15:56 BAOJDB4
    ___ MQQDPLO2 ENA Q_DEPTH_LOW      MQS        0 MQVARS 2 YY/MM/DD 15:56 BAOJDB4
    ___ MQSVINTH ENA Q_SERVICE_INTERV MQS        0 MQVARS 1 YY/MM/DD 15:56 BAOJDB4
    ___ MQSVINT2 ENA Q_SERVICE_INTERV MQS        0 MQVARS 2 YY/MM/DD 15:56 BAOJDB4
    ___ MQSVINOK ENA Q_SERVICE_INTERV MQS        0 MQVARS 1 YY/MM/DD 15:56 BAOJDB4
    ___ MQSVINO2 ENA Q_SERVICE_INTERV MQS        0 MQVARS 2 YY/MM/DD 15:56 BAOJDB4
    ___ MQPUTENA ENA PUT_INHIBITED    MQS        0 MQVER MQ YY/MM/DD 14:51 JDB3    
    ___ MQPUTEN2 SUS PUT_INHIBITED    MQS        0 MQVER MQ YY/MM/DD 14:51 JDB3    
    ___ MQQFULL  ENA Q_FULL           MQS        0 MQVER MQ YY/MM/DD 20:49 JDB3    
    ___ QUEUE1   ENA                  MQS        0 VARDISP  YY/MM/DD 15:56 BAOJDB4
    ___ APQHI    ENA Q_DEPTH_HIGH     MQS        0          YY/MM/DD 18:32 BAOJDB4
    ___ CLOSAP   ENA                  MQS        0          YY/MM/DD 16:06 BAOJDB4
           ************************* END OF DATA **************************

    The Rule is enabled and fires when an MQFMT_STRING message with the CLOSE ALL message text is detected for the PROD.AP.QUEUE queue within the CSQ1 queue manager. However, at this point, the Rule is not saved to disk.

    Warning

    Note

    Be aware that the variable IMFTEXT, which is passed to an EXEC when scheduled from a Rule, has the same limitations as the MSG Buffer of the Selection Criteria Panel, 255 bytes. For more information regarding IMFTEXT, see Chapter 4 in the MainView AutoOPERATOR Advanced Automation Guide.

    To access data in the message beyond 255 bytes, you must use an EXEC. By using a CLIST, you can access up to 32,767 bytes of the message content and by using a REXX EXEC, you can access up to 16 MB (minus 48 bytes for the message header) of the message content..

  12. To save the Rule, type the SAVE primary command on the COMMAND line.If you do not type the SAVE primary command, the warning shown in the figure below is displayed when you press PF3:

    Figure 12. Confirming Rule Set Modifications Panel

    BMC Software --------- Confirm Rule Set Modifications --------- AutoOPERATOR
    COMMAND ===>                                                 TGT  --- SYSE
    +----------------------------------------------------------------------------+
     + WARNING! Changes made to Rule Set AAORUL00 have not been saved.  Those     +
     + changes were one or more of the following:                                 +
     +                                                                            +
     +  o A Rule was changed.                                                     +
     +  o The status of a Rule was modified.                                      +
     +  o A Rule was added, deleted, inserted, or copied.                         +
     +  o A Rule was moved.                                                       +
     +  o The individual Rule Set strategy changed.                               +
     +  o A FILTER was added or modified.                                         +
     +  o The Rule Set description was modified.                                  +
     +                                                                            +
     + Please do one of the following:                                            +
     + - Enter SAVE to save AAORUL00 to the BBIPARM dataset for permanent change. +
     + - Enter NOSAVE  to exit WITHOUT saving AAORUL00 to the BBIPARM dataset.    +
     + - Press END to return to Rule Set Overview.                                +
     +                                                                            +
     + Note - A cold start refreshes all Rules from BBIPARM.  The changes that    +
     +        you have made will not remain over a cold start unless SAVEd.       +
     +----------------------------------------------------------------------------+

    The options are as follows:

    • Type SAVE to save the Rule.
    • Type NOSAVE to cancel saving the newly created Rule to disk, but leaving memory copy intact.
    • Press End to return to the Rule Set Overview panel.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

MainView AutoOPERATOR 8.2