z/OS Batch Runtime Planning and User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


DLL considerations for COBOL and Java

z/OS Batch Runtime Planning and User's Guide
SA23-1376-00

In effort to simplify, some information from Enterprise COBOL for z/OS®, V4R2, Programming Guide, SC23-8529 is repeated in this section of the documentation. For complete details, see Enterprise COBOL for z/OS, V4R2, Programming Guide at http://publibfp.boulder.ibm.com/epubs/pdf/igy3pg50.pdf

It is important to recognize the structural implications to COBOL source files when they are calling out to Java™. In particular, you need DLL and RECURSIVE on COBOL classes and methods or on COBOL programs that invoke Java methods.

To compile COBOL source code that contains OO syntax, such as INVOKE statements or class definitions, or that use Java services, you must use these compiler options:
  • RENT
  • DLL
  • THREAD

Any programs that you compile with the THREAD compiler option must be recursive. You must specify the recursive clause in the PROGRAM-ID paragraph of each OO COBOL client program. This can affect the overall COBOL program structure because a program compiled with a DLL cannot make a traditional COBOL dynamic call. It can, however, be statically linked with and call into another COBOL program compiled dynamic. This separate but statically linked program can then use a traditional dynamic call to other external COBOL modules with built dynamic programs.

In general, DLL linkage built COBOL programs can only call out to other external DLL linkage built programs. Similarly, dynamic call built COBOL programs can only call out to other external dynamic call built programs. However, static linking of objects with either two of these external program call mechanisms is allowed. This provides the bridging between the DLL linkage that Java requires and the traditional COBOL dynamic call.

For additional details, see the topic about "Using DLL linkage and dynamic calls together " in Enterprise COBOL for z/OS, V4R2, Programming Guide.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014