Compiling OO applications in JCL or TSO/E
If you use batch JCL or TSO/E to compile an OO COBOL program
or class definition, the generated object file is written, as usual,
to the data set that has ddname SYSLIN
or SYSPUNCH
.
You must use compiler options RENT
, DLL
, THREAD
,
and DBCS
. (RENT
and DBCS
are
defaults.)
If the COBOL program or class definition uses the JNI
environment structure to access JNI callable services, copy the file JNI.cpy from
the z/OS® UNIX file system to a PDS or PDSE member
called JNI, identify that library with a SYSLIB DD
statement,
and use a COPY
statement of the form COPY
JNI
in the COBOL source.
A COBOL source file that contains a class definition must not contain any other class or program definitions.
When you compile a COBOL class definition, a Java™ source program that contains
a class definition that corresponds to the COBOL class definition
is generated in addition to the object file. Use the SYSJAVA
ddname
to write the generated Java source
file to a file in the z/OS UNIX file system.
For example:
//SYSJAVA DD PATH='/u/userid/java/Classname.java',
// PATHOPTS=(OWRONLY,OCREAT,OTRUNC),
// PATHMODE=SIRWXU,
// FILEDATA=TEXT
Do not edit this generated Java class definition in any way. If you change the COBOL class definition, you must regenerate both the object file and the Java class definition by recompiling the updated COBOL class definition.
Compile Java class definitions by using
the javac
command from a z/OS UNIX shell command prompt, or
by using the BPXBATCH utility.
Example: compiling, linking, and running an OO application using JCL
Compiling with JCL
Compiling under TSO
Specifying source libraries (SYSLIB)
Defining the Java-source output file (SYSJAVA)
Accessing JNI services
Compiling OO applications under z/OS UNIX
Preparing OO applications under z/OS UNIX
DBCS
DLL
RENT
THREAD
JNI.cpy copybook
UNIX System Services User's Guide (The BPXBATCH utility)