Preparing and running OO applications in JCL or TSO/E
It is recommended that you run OO applications in a z/OS® UNIX environment. To run OO applications from batch JCL or TSO/E, you should therefore use the BPXBATCH utility.
In limited circumstances, however, you can run an OO application by using standard batch JCL (EXEC PGM=COBPROG) or the TSO/E CALL command. To do so, follow these requirements when preparing the application:
- Structure the application to start with a COBOL program. (If an
application starts with a Java™ program
or with the
mainfactory method of a COBOL class, you must run the application under z/OS UNIX, and the application components must reside in the z/OS UNIX file system.) - Link-edit considerations: Link the program
object for the COBOL program into a PDSE. COBOL
programs that contain object-oriented syntax must be link-edited with
AMODE 31.
Ensure that the class files and DLLs associated with
the COBOL or Java classes that
are used by the application reside in the z/OS UNIX file system. You must name the class files and DLLs as described in the related task about preparing OO applications under z/OS UNIX.
- Specify INCLUDE control
statements for the DLL side files libjvm.x and igzcjava.x when
you bind the object deck for the main program. For example:
INCLUDE '/usr/lpp/java/J5.0/bin/j9vm/libjvm.x' INCLUDE '/usr/lpp/cobol/lib/igzcjava.x' - Create
a file that contains the environment variable settings that are required
for Java. For example, a file /u/userid/javaenv might
contain the three lines shown below to set the PATH, LIBPATH, and
CLASSPATH environment variables.
PATH=/bin:/usr/lpp/java/IBM/J7.1/bin LIBPATH=/lib:/usr/lib:/usr/lpp/java/J5.0/bin:/usr/lpp/java/IBM/J7.1/bin/j9vm CLASSPATH=.:/u/userid/applicationsTo customize the initialization of the JVM that will be used by the application, you can set the COBJVMINITOPTIONS environment variable in the same file. For example, to access enterprise beans that run in a WebSphere® server, you must set the Java system property java.naming.factory.initial. For details, see the related task about running OO applications.
When you run an OO application that starts with a COBOL
program by using standard batch JCL or the TSO/E CALL command,
follow these guidelines:
- Use
the _CEE_ENVFILE environment variable to indicate the location of
the file that contains the environment variable settings required
by Java. Set _CEE_ENVFILE by
using the
ENVARruntime option. - Specify
the
POSIX(ON)andXPLINK(ON)runtime option. - Use
DDstatements to specify files in the z/OS UNIX file system for the standard input, output, and error streams for Java:JAVAIN DDfor the input from statements such asc=System.in.read();JAVAOUT DDfor the output from statements such asSystem.out.println(string);JAVAERR DDfor the output from statements such asSystem.err.println(string);
- Ensure that the SCEERUN2 and SCEERUN load libraries are available
in the system library search order, for example, by using a
STEPLIB DDstatement.
Example: compiling, linking, and running an OO application using JCL
Preparing OO applications under z/OS UNIX
Running OO applications under z/OS UNIX
Structuring OO applications
UNIX System Services User's Guide (The BPXBATCH utility)
Language Environment® Programming Guide (Running an application under batch)
XL C/C++ Programming Guide (_CEE_ENVFILE)
Language Environment Programming Reference (ENVAR)