Sometimes rules are not performing the actions they are supposed to be performing or the results are not the expected. Sometimes messages for special events do not appear in the OPSLOG so it becomes hard to debug the rules that react to those events. This article discusses some debugging techniques that are available in CA OPS/MVS.
REXX TRACE Built-in Function
Use the REXX TRACE instruction for debugging logic problems in your AOF rules. The TRACE instruction is the primary tool for determining why a rule is not doing what you expect. Use this statement for debugging purposes only. Having the TRACE statement in frequently triggered AOF rules will flood the OPSLOG with trace messages.
You can view the trace output in the OPSLOG. Depending on the TRACE setting, the function can resolve expression results, variable values, results of function calls, and so on. The most commonly used TRACE setting is R, which you can implement in a rule by coding the REXX statement TRACE R. Be sure to include the TRACE statement in the appropriate section of the rule you are debugging. For example, coding a TRACE R statement in the )INIT section causes only the )INIT section code to produce trace output. For more details regarding the TRACE instruction, see any REXX guide.
More than one AOF rule can process a single system event, which can often lead to conflicting logic.
To determine if you have multiple AOF rules executing on the same event, display the RULESET and COUNT columns in the OPSLOG facility. These fields tell you the following:
COUNT The number of rules that executed on the event RULESET The rule set and the rule that executed on the event first (or the only rule that executed if COUNT=1)
By default, the OPSLOG records only the first rule that executed on the event. If COUNT > 1 and you need to reveal all rules that processed the event, set the RULETRACE parameter to ON, and re-initiate the event. This parameter setting causes the OPSLOG to record each AOF rule that processed the event.
With CA OPS/MVS 12.3 an enhancement was introduced to show in OPSLOG the ruleset and rulename for the first five rules that fire on an event. This enhancement requires CA OPS/MVS 12.3 PTFs RO81845 and RO81846.
Set RULETRACE to ON for debugging purposes only.
You can set the RULETRACE parameter manually using OPSVIEW option 4.1.1 or programmatically using the OPS/REXX OPSPRM built-in function.
BROWSExxx Parameter - Can be used when events aren't showing up in OPSLOG
The BROWSExxx parm will cause events to be recorded in the OPSLOG.
For example, if you are debugging a particular EOJ rule, you can set the BROWSEEOJ parameter to YES to cause EOJ events to be recorded in the OPSLOG.
CA OPS/MVS - OPSLOG Parameters
CA OPS/MVS - Rule Related Parameters - RULETRACE