Establishing Connections

Requesting and Responding Libraries

In any linkage attempt, one library is known as the requesting library, and the other library is known as the responding library. The same connection library can be used as the requesting library to establish one of its connections, as well as the responding library when establishing another of its connections.

Explicit, Implicit, and Direct Linkage

You can establish linkage between connection libraries in any of the following ways:

  • Using explicit linkage.In this method, the requesting library process executes a LINKLIBRARY function, and the responding library process executes a READYCL function.

  • Using implicit linkage.In this method, the requesting library process simply accesses an import object in an unlinked connection, and the responding library process executes a READYCL function.

  • Using direct linkage.In this method, a process specifies a LINKLIBRARY function that specifies the identifiers of both the requesting library and the responding library.

Linkage Errors

Linkage errors have different effects, depending on the type of linkage that is used. If an implicit linkage results in an error, that error is fatal for the client program. On the other hand, if an explicit or direct linkage results in an error, the error is nonfatal and is communicated to the client program as a LINKLIBRARY function result.

Matching Libraries

Relative to any connection library, the library on the other end of the connection can be referred to as the matching library.

Approving and Monitoring Linkages

Each library program can contain APPROVAL and CHANGE procedures that determine whether to allow the linkage and monitor the status of the linkage.

Sharing Instances of Connection Library Programs

Each process that is an execution of the same connection library program is referred to as an instance of that library program. You use the sharing option of a library program to tell the system to decide whether to initiate a new instance of the library when the library is being linked to. You can also initiate connection library programs explicitly through task initiation statements.

Equal Partnership in Connections

Once two connection libraries are linked, the distinction between requesting and responding is no longer meaningful. Both libraries are equal partners in the connection, and each can import objects from or export objects to the matching library. Further, either side can sever the connection, as described in Delinking Connection Libraries.

The following pages describe each of these connection library features in more detail.