COBOL Manual for TNS/E Programs (H06.03+)

Libraries and Utility Routines
HP COBOL Manual for TNS/E Programs520347-003
13-4
Dynamic-Link Libraries (DLLs)
Dynamic-Link Libraries (DLLs)
A DLL is a library of shared code [PIC] that contains functions or data for other PIC
loadfiles. (For more information about PIC and DLLs, see the DLL Programmers
Guide for TNS/E Systems.)
You can put a program in a DLL if:
It is not a main program.
It does not contain embedded SQL/MP or SQL/MX statements.
It does not contain external objects (data or files that are to be shared with code
that is outside the library).
If you put an HP COBOL program in a DLL, you must export the program name when
you build the DLL; otherwise, other programs cannot call the HP COBOL program. To
export the HP COBOL program name, use either the ELD directive (Guardian) or the
-Weld option (OSS and PC), with one of the linker options in Table 13-3.
Topics:
Building a DLL From a Single Source File
Building a DLL from Multiple Source Files
Specifying a DLL
Building a DLL From a Single Source File
The single source file from which you build the DLL can contain one or more source
programs.
You can build a DLL from a single source file in either one step or two: either compile
the source file and have the compiler call the linker, or compile the source file and call
the linker yourself. (For linker instructions, see the eld Manual.)
Topics:
Guardian Environment: One-Step Method
Guardian Environment: Two-Step Method
Note. ASSIGN and PARAM commands for files in a DLL are ignored.
Table 13-3. Linker Options That Export Program Names
Environment
Option exports ...
All program names
in the source file Only the specified program name
Guardian ELD (-export_all) ELD (-export program-name )
OSS and PC -Weld="-export_all" -Weld="-export program-name "