CONNECTION LIBRARY Declaration

Connection libraries provide the ability to establish asynchronous two-way connections between libraries that provide access to the procedures of the connected library.

<connection library declaration>

──<connection block type identifier>─┬──────────┬─┬─────────────┬──────►
                                     └─ SINGLE ─┘ ├─ EXPORTING ─┤
                                                  └─ IMPORTING ─┘
            ┌◄──────────────── , ────────────────┐
►─ LIBRARY ─┴─<connection library specification>─┴─────────────────────┤

When you declare a connection library, if you specify SINGLE, then only a single connection is allowed for this connection library and a connection index must not be specified when referencing an item of a connection block. An attempt to modify the CONNECTIONS attribute of a SINGLE library to a value other than 1 results in an attribute error.

If you specify EXPORTING, the compiler gives a syntax error if the specified connection block contains imports. If you specify IMPORTING, the compiler gives a syntax error if the specified connection block contains exports. EXPORTING and IMPORTING cannot appear in FORWARD declarations of connection libraries.

<connection library specification>

──<identifier>── ( ──<library attribute specifications>── ) ───────────┤

The <procedure identifier> specified for the CHANGE <procedure-valued library attribute name> must be declared inside the specified connection block. The <procedure identifier> specified for the APPROVAL <procedure-valued library attribute name>must be declared outside of the specified connection block if it is declared at all.

<connection library identifier>

An identifier that is associated with a connection library specification in a CONNECTION LIBRARY declaration.

<connection library instance designator>

──<connection library identifier>──────────────────────────────────────►
►─┬───────────────────────────────────┬────────────────────────────────┤
  └─ [ ──<arithmetic expression>── ] ─┘

A <connection library instance designator> specifies a particular instance of a connection library. If the connection library was declared without specifying SINGLE, the brackets and <arithmetic expression> must be included in order to specify a particular instance. The arithmetic expression must evaluate to a nonnegative integer.

For more information about procedure-valued library attributes, see the Task Management Programming Guide.