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.

Start of changeConsideration for AMODE 64End of change

Start of changeA 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.End of change

Start of changeThe 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.End of change

In an application with DLL support, use the following compiler options depending on where the programs or classes are:

Table 1. Compiler options for DLL applications
Programs or classes in: Start of changeIn LP(32)End of changeCompile with: Start of changeIn LP(64) Compile with:End of change
Root program object DLL, RENT, NOEXPORTALL Start of changeNOEXPORTALLEnd of change
DLL program objects used by other program objects DLL, RENT, EXPORTALL Start of changeEXPORTALLEnd of change

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

Related references  
DLL  
EXPORTALL  
LP
RENT