To every rule there is a number assigned as the rule is defined. The rules then are subsequently iden-
tified by their numeric value.

It is also possible to delete all defined or partially defined rules by issuing the following command


HAO CLEAR

13.4 Substituting Substrings

The command may contain special variables ($1, $2, $3, etc.) which will be replaced by the values of
“capturing groups” in the match pattern. A capturing group is a part of the regular expression enclosed in
parenthesis which is matched with text in the target message. In this way commands may be constructed
which contain substrings extracted from the message which triggered the command.

The following special variables are recognized:

$1 to $9 the text which matched the first to nineth capturing group in the target regular
expression.
$` - the text preceeding the regular expression match. $’ the text following the regular expression match. $$ - replaced by a single dollar sign.

Note that the substitution of a $n variable does not occur if there are fewer than n capturing groups in the
regular expression.

13.5 Limitations

The current implementation limits the total number of defined rules to 64. This limit may be raised by in-
creasing the value of the HAO_MAXRULE constant in module “hao.c” and rebuilding Hercules.

All defined rules are checked for a match each time Hercules issues a message. There is no way to
specify “stop processing subsequent rules”. If a message is issued that matches two or more rules, each
associated command is then issued in sequence.

13.6 Examples

Example 1:

Issue the command “i 0700” in response to the message:

HHC01090I 0:0700 COMM: client 127.0.0.1 devtype 3270: connection reset

The following HAO commands define the desired rule:

HAO TGT HHC01090I 0:([0-9A-F]{3,4})

HAO CMD i $1

Example 2:

Use the dot matrix display of a 3480 tape unit to implement an automatic tape library (please note that the
first HAO command has been split over two lines to fit on the page):

HAO TGT HHC00224I 0:([0-9A-F]{4}) Tape file *, type aws:

display (?:".{8}" / )?"M([A-Z0-9]{1,6})\s*S"

HAO CMD devinit $1 D:\MVSTAPES\$2.AWSTAPE

Previous Page Next Page