Compiling programs to create DLLs
When you compile a COBOL program with the DLL
option,
it becomes enabled for DLL support. Applications that use DLL support
must be reentrant. Therefore, you must compile them with the RENT
compiler
option and link them with the RENT
binder option.
Consideration for AMODE 64
A COBOL program compiled with the LP(64)
compiler
option is already enabled for DLL support and is reentrant. The LP(64)
options
implies DLL
and RENT
. If NODLL
or
NORENT
are specified, the compiler discards these options with warning messages. A
program compiled with LP(64)
can be linked with a DLL or non-DLL application.
The LP(64)
option implies
RMODE(ANY)
. If RMODE(24)
is specified, the compiler discards the
option with a warning message. AMODE 64 COBOL programs are loaded below the bar.
In an application with DLL support, use the following compiler options depending on where the programs or classes are:
Programs or classes in: | In LP(32) Compile
with: |
In LP(64) Compile with: |
---|---|---|
Root program object | DLL , RENT ,
NOEXPORTALL |
NOEXPORTALL |
DLL program objects used by other program objects | DLL , RENT , EXPORTALL |
EXPORTALL |
If a DLL program
object includes
some programs that are used only from within the DLL module, you can
hide these routines by compiling them with NOEXPORTALL
.
Example: sample JCL for a procedural DLL application