Sample using the exec class

General discussion on the JZOS batch launcher and toolkit
Post Reply
usaajrm
Posts: 87
Joined: Tue Feb 06, 2007 3:46 pm

Sample using the exec class

Post by usaajrm »

Does an example exist for the exec class? We want to run a MVS program from a java program. The program requires on string argument and returns a return code of 0, 4, 8 or 12. We are new to java and would appreciate a sample. thanks.
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

The com.ibm.jzos.Exec class is a wrapper for Runtime.exec(), and it can be used to launch a z/OS Unix command as a child process.

To run a MVS program that is not a Unix command, you would have to either write a simple Unix command wrapper or you could write a REXX Unix shell script and use one of the Rexx apis like "AttachMVS" to run your program.

There are several examples of using Exec to run REXX scripts in the IBM JZOS Sample code. Look at the following classes in the com.ibm.jzos.sample package:

MvsJobOutput
MvsJobSubmitter

The JZOS sample source code is available here:
http://www-03.ibm.com/servers/eserver/z ... rview.html
Post Reply