CA OPS/MVS

Expand all | Collapse all

Tuesday Tip: Mirror Mirror on the Wall what is the best OPS/MVS variable of all?

  • 1.  Tuesday Tip: Mirror Mirror on the Wall what is the best OPS/MVS variable of all?

    Posted 08-26-2014 01:15 PM

    The need to create variables is a common coding task within the logic of your automated applications. Within the OPS/MVS tool box, there are many flavors of variables that can be utilized in your OPS/MVS rules and programs to handle this task. More often than not, the wrong type of variable is being chosen which can possibly make the application less efficient, and even have you creating more lines of code than what is needed to perform the desired automated action.

     

    Today’s Tuesday Tip will be part 1 of 5, that will outline the various types of OPS/MVS variables available in rules and programs, providing you with the details needed to effectively utilize them within your applications.  For today’s variable type, we will take a look at Static Variables, with future tip topics discussing local variables, global variables, shared  variables that utilize the OPS/MVS shared data base file, and shared sysplex variables that utilize the CA CCS Common Variable Service component (CAVARSRV).


    OPS/MVS Static Variables

    Static variables maintain their value across multiple executions of a single rule, which means that data can be shared between executions of the same AOF rule. Static variables are primarily useful within AOF rules when you need to keep a running counter of the triggering event, or perhaps compare some condition within the current event, against a value that the event contained in a previous firing of the rule.

     

    For example, consider the following rule logic:

    )MSG $HASP373                                          

    /************************************************************/

    /* Rule Purpose :     Keep a running total of HASP373 jobs  */

    /*                    on this system. Create an audit trail */

    /*                    message of this count upon the rule   */

    /*                    being disabled.                       */

    /************************************************************/

    )Init 

    /************************************************************/

    /* Initialize our static counter variable for this event    */

    /************************************************************/

    count = 0

    )Proc

    count = count + 1                        /* Add to counter  */

    )Term 

    /************************************************************/

    /* Rule being disabled. Create OPSLOG audit trail msg       */

    /************************************************************/

    msgtxt = 'OPSINFO - Total $HASP373 events = 'count

    logit = OPSSEND('*','B',msgtxt)

     

    The variable COUNT is a static variable that retains its value each time this rule processes a $HASP373 message.

     

    Review the following additional facts about static variables:

    • Static variables are rule specific and must be defined (initialized) in the )INIT section.
    • The same static variable name used in the initialization sections of two different rules refers to two different static variables.
    • A static variable cannot be a compound symbol (for example, JOB.COUNT).
    • The name of a static variable can be up to 50 characters in length.
    • The value assigned to a static variable can be up to 256 bytes in length. Any value assigned with a length greater than 256 is truncated.
    • A static variable is deleted when the rule is disabled.

     

         Next week’s Tuesday Tip will look at Address Space (ASID) related variables that will allow you to create uniqueness within rules for common events issued from different address      spaces.



  • 2.  Re: CA OPS/MVS Tuesday Tip: Mirror Mirror on the Wall what is the best OPS/MVS variable of all?

    Posted 11-28-2014 04:35 AM

    Hello David,

     

    This was interesting for a new person using OPS/MVS. When will the next four articles be coming out?

     

    Thanks

    Mark Noonan



  • 3.  Re: Tuesday Tip: Mirror Mirror on the Wall what is the best OPS/MVS variable of all?

    Posted 07-16-2018 08:29 AM

    Dave,

     

    "Static variables are primarily useful within AOF rules when you need to keep a running counter of the triggering event... " for this particular purpose, would you current recommend using the OPSTHRSH function? I've been trying to use this to control whether or not to take an action depending on how may time the event has occurred in the last xx minutes etc.

     

    thanks,

     

    Steve

     



  • 4.  Re: Tuesday Tip: Mirror Mirror on the Wall what is the best OPS/MVS variable of all?

    Broadcom Employee
    Posted 07-17-2018 11:59 AM

    Hi Steve,

     

    The recommend method to avoid repetitive actions from rules is the usage of the function OPSTHRSH. This is a relatively new function (added in OPS 12.2) so, in the past, it was necessary to keep the counter in static variables of AOF rules.

    Just for reference for who may have interest in this function, more information can be found in the link below:

    OPSTHRSH Function - CA OPS/MVS® Event Management and Automation - 13.0 - CA Technologies Documentation 

     

    Regards,
    Mario

    Carlos Mario Filho
    Principal Support Engineer