SHARED_LIBRARY_LIST

This variable allows you to specify the names of UNIX/Linux shared object libraries or Windows DLLs.

SHARED_LIBRARY_LIST can be set in one of three ways:

  1. In the environment
  2. In the runtime configuration file
  3. Programmatically with the SET ENVIRONMENT statement

The runtime loads the listed objects on program startup or as the result of a SET ENVIRONMENT statement. Names must be delimited by spaces, colons (UNIX/Linux), or semicolons (Windows).

With DLLs, you can specify both the name of the DLL and the calling convention to use. Any calling convention specified this way overrides the DLL_CONVENTION variable setting.

You can also list objects without path information and use the SHARED_LIBRARY_PREFIX configuration variable to specify a set of directories that the runtime will search when attempting to load a shared library.

Once loaded, functions exported by these libraries can be called directly.

The SET ENVIRONMENT statement can be used to set SHARED_LIBRARY_LIST any number of times during program execution. Each time it is set, the runtime loads the libraries listed. Previously loaded libraries remain loaded. Libraries loaded with SHARED_LIBRARY_LIST remain in memory until the process exits. The CANCEL statement cannot be used to unload the library.

On some systems, such as AIX, if the shared module is a member of an archive, you must specify the name of the member in parentheses after the name of the archive. For example:

SHARED_LIBRARY_LIST="/usr/opt/db2_08_01/lib/libdb2.a(shr.o)"

SHARED_LIBRARY_LIST is like the runtime -y option, except that it does not require setting the SHARED_LIBRARY_EXTENSION variable, and unlike -y, you can mix .a and .so libraries in the list.

Note: The SHARED_LIBRARY_LIST configuration variable does not load client-side DLLs for thin client applications that make calls using the CALL verb @[DISPLAY]: syntax. These applications must explicitly load the DLL by calling it with the CALL verb before calling a function within the DLL.
Note: This variable cannot be read with the ACCEPT FROM ENVIRONMENT statement.