Implicitly Linking Connection Libraries

Implicit linkage can occur if a process accesses an import object in a connection and no matching library has yet been linked to that connection.

Example of Causing Implicit Linkage

For example, suppose a connection library LIB1 has import declarations for three procedures: PROC1, PROC2, and PROC3. Suppose also that LIB1 has two connections, and the connection library process uses the LINKLIBRARY function to initiate linkage for connection 0. The connection library process then invokes PROC2 in connection 1. Note that, at this point, connection 1 has not yet been linked to a matching library.

AUTOLINK Library Attribute

The AUTOLINK library attribute determines what happens at this point. If AUTOLINK is FALSE (the default value), then the attempt to invoke PROC2 fails with a fatal run-time error. If AUTOLINK is TRUE, then the system proceeds with an attempt to link the connection to a matching library. The system uses library attributes to search for the match, as previously described in “Assigning Connection Library Attributes.”

READYCL Function Required

For linkage to reach completion, the matching library must be readied by a READYCL function, as described in “Using READYCL for the Responding Library.”

Missing Library

If the matching library program is not ready or otherwise cannot be found, the invoking process becomes suspended at this point. If the LIBACCESS value is BYTITLE, then a “NO LIBRARY” message is displayed as the RSVP message. If the LIBACCESS value is BYFUNCTION, and the FUNCTIONNAME library attribute requests a function name that does not exist, the RSVP message is “FUNCTION <function name> IS NOT DEFINED, SL, FA, OR DS.”

Missing Objects

If the matching library program is found, the system links the requesting library to an existing instance of the matching library program or initiates a new instance as discussed under Implicitly Initiating a Server Library later in this section. The system then checks to see if the requested object is exported by the matching library. If the requested object is not available, the system returns one of the errors discussed in Matching Connection Library Objects.