Previous Topic

Next Topic

Book Contents

Book Index

General Information for DO RULE (CMEM)

To define a DO RULE statement in a CMEM rule, and to access a CMEM rule containing a DO RULE statement, Control-O must be installed.

Note: To order a CMEM rule containing a DO RULE statement and to invoke the Control-O rule specified in the CMEM DO RULE statement, Control-O must be active.

When a DO RULE statement is encountered during rule processing, Control-O invokes the specified rule. When processing of the invoked rule is completed, processing continues sequentially from the point after the DO RULE statement in the initial (calling) rule.

When a DO RULE statement is executed, the specified rule is searched for among the loaded rules according to the specified rule name, table, library, and owner. If the rule is found but is not active, for example, if the runtime scheduling criteria are not satisfied, the "invoked" rule is not executed and the calling rule continues execution with the next DO statement.

The CMEM calling rule can pass an argument string as input to the called rule. This argument string can contain CMEM AutoEdit expressions that are resolved at time of rule execution. The argument string can be accessed by the called rule through Control-O System variable %%$ARGS. If a called rule calls another Control-O rule, the %%$ARGS values passed in the earlier call are overwritten by the %%$ARGS values passed by the later call. For information about the AutoEdit facility in Control-O, see the Control-O User Guide.

A Control-O rule specified with an ON RULE statement can be invoked any number of times by DO RULE calls.

A called Control-O rule can invoke other Control-O rules using DO RULE statements. Nesting of DO RULE calls, for example, rule 1 calls rule 2, that calls rule 3, up to 20 deep is supported. A Control-O rule can be called recursively.

Parent Topic

DO RULE (CMEM): Action Parameter