13. The “Hercules Automatic Operator” (HAO) Facility
13.1 HAO Introduction
The Hercules Automatic Operator (HAO) feature is a facility which can automatically issue panel com-
mands in response to specific messages appearing on the Hercules console.
To use the Hercules Automatic Operator facility, you first define a rule consisting of a target and the
associated command. The target is a regular expression pattern used to match against the text of the
various messages that Hercules issues as it runs. Whenever a match is found, the rule “fires” and ist
associated command is automatically issued.
The Hercules Automatic Operator facility only operates on messages issued to the Hercules console.
These messages may originate from Hercules itself or from the guest operating system via the SCP
SYSCONS interface or via the integrated console printer-keyboard (3215-C or 1052-C). HAO cannot
intercept messages issued by the guest operating system to its own terminals.
13.2 Defining HAO Rules
To define a HAO rule, enter the command
HAO TGT target
to define the rule’s target match pattern, followed by the command
HAO CMD command
to define the rule’s associated panel command.
The target is a regular expression as defined by your host platform. When running on Linux, Hercules
uses POSIX Extended Regular Expression syntax. On a Windows platform, regular expression support is
provided by Perl Compatible Regular Expression (PCRE). The HAO facility can only be used if regular
expression support was included in Hercules at build time.
The associated command is whatever valid Hercules panel command you wish to issue in response to a
message being issued that matches the given target pattern.
13.3 Deleting HAO Rules
To delete a fully or partially defined HAO rule, first use the the following command to get a list of all of the
defined (or partially defined) rules
HAO LIST [nnn]
Where nnn is the (optional) number of an existing rule. This gives you the list of all rules with the specified
identifier or lists the rule with identifier ‘nnn’. Then use the next command to delete the specific rule identi-
fied by the identifier ‘nnn’
HAO DEL nnn