Using procedure or function pointers with DLLs

In run units that contain both DLLs and non-DLLs, use procedure- and function-pointer data items with care.

The SET procedure-pointer-1 TO ENTRY entry-name statement, SET function-pointer-1 TO ENTRY entry-name statement, and the CALL statement have a call linkage type that associates with them. The call linkage type is determined by the compiler options and the CALLINTERFACE directive that are in effect on that statement. In a program that is compiled with the DLL option, the default call linkage type is DLL. Otherwise, the linkage type is non-DLL. This default can be overridden by the CALLINTERFACE directive.

For a procedure-pointer or function-pointer data item that is set by a SET statement with linkage type non-DLL, it must not be used by a CALL statement with linkage type DLL. For a SET statement with linkage type DLL and the entry-name is an identifier, and if the NODYNAM option is in effect, the entry-name identifier value must refer to the entry-point name that is exported from a DLL module. The DLL module name must match the name of the exported entry point. In this case, note also that:

  • The program-name that is contained in the identifier is interpreted according to the setting of the PGMNAME(COMPAT|LONGUPPER|LONGMIXED) compiler option of the program that contains the CALL statement.
  • The program-name that is exported from the target DLL is interpreted according to the setting of the PGMNAME option used when compiling the target program.
  • The search for the target DLL in the z/OS® UNIX file system is case sensitive.
  • If the target DLL is a Start of changePDSEEnd of change member, the DLL member name must have eight characters or less. For the purpose of the search for the DLL as a Start of changePDSEEnd of change member, the name is automatically converted to uppercase.

related references  
DLL  
EXPORTALL
CALLINTERFACE (Enterprise COBOL for z/OS Language Reference)