raj
raj

Reputation: 11

Invoking JCL from Java

I have been working in java for the past 4 years. I would like to inform that my knowledge in mainframes system is a BIG 0 and am looking for a way to invoke a JCL scrip from a java class.

Can someone please let me know a way of doing this? What are all the per-requisites to accomplish the same?

Upvotes: 1

Views: 4549

Answers (3)

James Anderson
James Anderson

Reputation: 27478

Use "System.exec()" will invoke a USS (Unix System Services) shell.

You can then use one of the USS commands to start your JCL running:

System.exec("tso SUBMIT 'YOUR.JCL.LIB(JOBNAME)'")

The JCL will then be scheduled -- it will run as a separate process when JES sees fit to run it -- you will not get any feedback from the job itself.

If you really want to run a legacy program and get some results back you will need to run it inside the USS shell either as a USS shell script or by invoking a TSO script from USS.

Upvotes: 1

Kjetil Ødegaard
Kjetil Ødegaard

Reputation: 681

You can use the FTP interface to JES to submit JCL jobs:

http://www.ehow.com/how_5213702_ftp-jcl-mainframe.html

Upvotes: 2

L. Cornelius Dol
L. Cornelius Dol

Reputation: 64026

IBM should have a Java toolkit available for interfacing with the native system. On the AS/400 (aka iSeries, i5, SystemI, ...) it was called JT/400 (Java Toolkit for the 400). I imagine they have something very similar for the zSeries (are they called SystemZ now?) machines.

Perhaps System.exec() might be implemented in the z/OS JVM to run a system job.


I have been googling for a while now and can't find anything for z/OS or OS/390 comparable to JT/400; it looks like you will need to dive into JNI to do what you want, if System.exec is of no use to you. Start with IBM's information on using JNI in OS/390.

Upvotes: 1

Related Questions