Preparing OO applications under z/OS UNIX
Use the cob2 command to link OO COBOL applications.
To prepare an OO COBOL client program for execution, link the object file with the following two DLL side files to create an executable module:
- libjvm.x, which is provided with your IBM® Java™ Software Development Kit.
- igzcjava.x, which is provided in the
libsubdirectory of the COBOL install directory in the z/OS UNIX file system. This DLL side file is also available as the member IGZCJAVA in the SCEELIB PDS (part of Language Environment®).
To prepare a COBOL class definition for execution:
- Link the object file using the two DLL
side files mentioned above to create an
executable DLL module.
You must name the resulting DLL module libClassname.so, where Classname is the external class-name. If the class is part of a package and thus there are periods in the external class-name, you must change the periods to underscores in the DLL module name. For example, if class Account is part of the com.acme package, the external class-name (as defined in the
REPOSITORYparagraph entry for the class) must be com.acme.Account, and the DLL module for the class must be libcom_acme_Account.so.
- Compile the generated Java source with the Java compiler to create a class file (.class).
For a COBOL source file Classname.cbl that contains the class definition for Classname, you would use the following commands to compile and link the components of the application:
cob2 -c -qdll,thread Classname.cbl
cob2 -bdll -o libClassname.so Classname.o
After you issue the cob2 and
successfully, you have the executable components for the program:
the executable DLL module libClassname.so and
the class file Classname.class.
All files from these commands are generated in the current working