Library Facility

The library facility is a feature that can be used to structure processes. A library is a program containing one or more library objects that can be accessed by other programs, which are referred to as calling programs. A library object is an object that is shared by a library and one or more user programs and is exported from the library using an export declaration. Exported procedures are called entry points into the library. Unlike a regular program, which is always entered at the beginning, a library can be entered at any entry point.

Libraries provide all the benefits of procedures plus the added advantages that they can be reused and shared by a number of programs. Consolidating logically related functions into a library can make programming easier and program structure more visible. A call on a procedure in a library is equivalent to a call on a procedure in the calling program.

Libraries offer the following improvements over binding:

  • Interlanguage communication is significantly improved.

  • Standard packages of functions, such as plotting and statistics, need not be copied into any calling programs.

    Libraries offer the following improvements over installation intrinsics:

  • A library can have its own global files, databases, transaction bases, and so on.

  • Libraries can contain initialization and termination code.

  • Libraries can themselves call other libraries.

  • Individual users can create their own libraries without possessing special privileges.

  • Libraries can be written in more languages than can the installation intrinsics.

  • More than one version of a library can be in use at a time.

For information about connection libraries, see the Task Management Programming Guide.