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