launching JCL on MVS

J

Jaime Wyant

Disclaimer - I've never used ftplib, so the code below hasn't actually
been tested..

First, create some JCL. For this example assume it is test.jcl and it
is in the CWD.

# Connect to the server
# Tell the server you're about to send it some JCL to execute
# Upload the JCL
The last command ought to print ought the Job ID (and a few other things).

Good luck and let me know if that works for you. Also, some of those
methods will raise exceptions if something goes wrong. Check out
ftplib.py for good documentation.

jw
 
C

Chris

Thanks, but what does it do? Upload test.jcl and execute it?
Let's say that I already have a "TEST" JCL on the HOST, how can I execute it
via an FTP command?

Chris
 
J

John Roth

Chris said:
Is it possible to use Python to launch JCL jobs on an IBM MVS HOST (OS390)
?

It's been a few years, but there is an IBM manual that explains
the MVS FTP server in excruciating detail. The MVS FTP
server is quite different from most FTP servers; I'd suggest
that you find the manual and read it.

IIRC, what you want to do is not particularly difficult,
but it's not at all obvious if all you know is the typical
unixoid and windows FTP servers.

John Roth
 
J

Jaime Wyant

The code i showed you submitted a job to the mainframe via ftp. The
catch was the JCL had to be in the CWD. I'm not sure how to submit a
job that is *already* on the mainframe...

A google pointed me here:

http://www.wright.edu/cats/docs/docroom/mainframe/mvsftp.htm

According to this document you:

1) create the JCL on the mainframe
2) issue this site command -> "SITE FILETYPE=JES"
Using ftplib's FTP object, that would be:
ftp.voidcmd( "quote site file=JES" )

3) issue a GET command -> GET jclfilename outputfilename
jclfilename is the job to submit.
outputfilename holds the output of the job.

I *think* you would use ftplib's retrlines function like so:
ftp.retrlines( "GET jclfilename", cbfun )

Where cbfun is a callback function that will receive the output of
the job one line at a time, sans the CR/LF.

hth,
jw
 
C

Chris

Thanks for the help!

Here is what worked:
ftp.voidcmd( "site file=JES" )
"quote" is already done by ftplib

ftp.retrlines( "RETR 'PATH.ON.HOST(JCLNAME)'")
GET is an unknown command, althought it's what works in FTP command line...

Chris

"Jaime Wyant" <[email protected]> a écrit dans le message de (e-mail address removed)...
The code i showed you submitted a job to the mainframe via ftp. The
catch was the JCL had to be in the CWD. I'm not sure how to submit a
job that is *already* on the mainframe...

A google pointed me here:

http://www.wright.edu/cats/docs/docroom/mainframe/mvsftp.htm

According to this document you:

1) create the JCL on the mainframe
2) issue this site command -> "SITE FILETYPE=JES"
Using ftplib's FTP object, that would be:
ftp.voidcmd( "quote site file=JES" )

3) issue a GET command -> GET jclfilename outputfilename
jclfilename is the job to submit.
outputfilename holds the output of the job.

I *think* you would use ftplib's retrlines function like so:
ftp.retrlines( "GET jclfilename", cbfun )

Where cbfun is a callback function that will receive the output of
the job one line at a time, sans the CR/LF.

hth,
jw
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top