The next figure shows the batch file that is used in the run-commands file (step 5) to start the tn3270
sessions.

@ECHO OFF

REM *******************************************************************************************

REM Start master console and wait for connection to Hercules

REM *******************************************************************************************

START /D "C:\Program Files (x86)\TomBrennanSoftware\VistaTN3270" VistaTN3270.EXE MVS38J_MST.SES

CHOICE /t 1 /d y

REM ******************************************************************************************

REM Start operator console and wait for connection to Hercules

REM *******************************************************************************************

START /D "C:\Program Files (x86)\TomBrennanSoftware\VistaTN3270" VistaTN3270.EXE MVS38J_OPR.SES

CHOICE /t 1 /d y

REM *******************************************************************************************

REM Start TSO terminals and wait for connection to Hercules

REM *******************************************************************************************

START /D "C:\Program Files (x86)\TomBrennanSoftware\VistaTN3270" VistaTN3270.EXE MVS38J_TSO.SES

CHOICE /t 1 /d y

START /D "C:\Program Files (x86)\TomBrennanSoftware\VistaTN3270" VistaTN3270.EXE MVS38J_TSO.SES

EXIT

Figure 351: Batch file to start tn3270 sessions

The CHOICE command used in the batch file is to issue a delay before trying to connect the next tn3270
session.

The “/t” parameter specifies the number of seconds to pause before a default choice is made. Option “/d”
specifies the default choice that is issued after the timeout has expired. The character given as argument
must be in the set of choices specified by the “/c” option (defaults are ‘Y’ and ‘N’).

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

Previous Page Next Page