


ACUCOBOL-GT allows you to use the CALL statement to call subroutines in UNIX shared libraries. Placing native code routines in shared libraries and calling them from your COBOL program is a convenient way to access native code routines without having to link them into the runtime. To use a routine located in a shared library, you must first load, or CALL, that library (see Book 3, Reference Guide, section 6.6 "Procedure Division Statements," CALL Statement, for syntax and rules). For example:
CALL "sharedlibrary.so"
If no relative or absolute path is specified in the CALL statement, the routine looks for the library in the current working directory and then in the location specified in the LD_LIBRARY_PATH environment variable (see Book 1, User's Guide, section 1.5, "Environment Variables" for more details).
Once the library has been loaded, all of the routines it contains can be called. For example:
CALL "sharedfunction"
The runtime searches for shared libraries after it has searched for COBOL programs.