14.4.4 Examples

Example 1:

Retrieve the value of the Hercules symbol “version”.

say 'Hercules version = ' VALUE('version',,'SYSTEM')

Example 2:

Retrieve the value of the Hercules environment variable “HERCULES_RC”.

say 'Hercules RC = ' value('HERCULES_RC',,'ENVIRONMENT')

14.5 Error Handling

The error handling differentiates between the following types of errors:

Command Errors Command Failures


An invalid command (‘command not found’) is treated as a ‘command error’. Command errors may be
handled with “SIGNAL ON ERROR”.

Failures in an otherwise valid command are treated as ‘command failures’. Command failures may be
handled with “SIGNAL ON FAILURE”.

Command return codes < 0 are interpreted as ERROR, return codes > 0 are interpreted as FAILURE.
Hercules will abort the startup process if the configuration file Rexx script returns with a non-zero return
code.

15. Submitting Jobs via the Socket Reader

15.1 Socket Reader Basics

The “sockdev” option allows you to submit cards directly to a Hercules card reader from outside of
Hercules. The card reader must be defined with the “sockdev” keyword and either a TCP/IP port number
or the name of a Unix Domain Socket. Then whenever you want to submit a card deck to that particular
card reader, you use an external program to connect to the socket and transmit the cards to the reader.
Socket readers were implemented by Fish, based upon code originally contributed by Malcolm Beattie.

Socket readers are defined in the Hercules configuration like this:

Descriptive

sockspec [option [option ... ]]

Diagram

Êʬ¬¬ ¬¬¬
¬¬¬ sockspec ¬¬¬ ¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬Ê





ʬ¬¬§¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬§¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬ÊÍ




option

Parameters devnum, devtype and the keyword SOCKDEV are the same as described in chapter

6.5
(“Card Reader Devices”).

The socket specification sockspec can take any of the following formats:

ipaddr:port

The reader listens on the specific IP address and port number. ipaddr must be The
IP address of an interface on the local system.

For example, “127.0.0.1:1234” is used to accept only jobs submitted locally via the
loopback interface.

hostname:port

Similar to the previous example, where hostname must resolve to an IP address
belonging to the local system.

Example: “localhost:1234”.

port

The reader listens on the specified port number and accepts jobs submitted from
any IP address defined on the local system.

Example: “1234”.

path/name

The reader listens on the specified Unix Domain Socket.

Example: “/tmp/hercrdr.00C”

Previous Page Next Page