Re: launching JCL on MVS

From: Chris (chrisNOSPAM_at_spam.com)
Date: 09/27/04


Date: Mon, 27 Sep 2004 10:06:16 +0200

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" <programmer.py@gmail.com> a écrit dans le message de news:
mailman.3236.1095084343.5135.python-list@python.org...
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

On Mon, 13 Sep 2004 15:41:22 +0200, Chris <chrisnospam@spam.com> wrote:
> 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
>
> "Jaime Wyant" <programmer.py@gmail.com> a écrit dans le message de news:
> mailman.3230.1095079924.5135.python-list@python.org...
>
>
> > 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
> > >>> from ftplib import FTP
> > >>> ftp = FTP("hostname") # connect to host, default port
> > >>> ftp.login("username", "password")
> >
> > # Tell the server you're about to send it some JCL to execute
> > >>> ftp.voidcmd( "quote site file=JES" )
> >
> > # Upload the JCL
> > >>> print ftp.storlines( "STOR", file("test.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
> >
> > On Mon, 13 Sep 2004 10:56:57 +0200, Chris <chrisnospam@spam.com> wrote:
> > > Is it possible to use Python to launch JCL jobs on an IBM MVS HOST
> (OS390) ?
> > >
> > > --
> > > http://mail.python.org/mailman/listinfo/python-list
> > >
>
>
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>



Relevant Pages

  • Re: FTP-ing files using vb6 codes
    ... All you need to do is refer to an FTP command list and implement the proper ... >> Veign's Resource Center ... >> Veign's Blog ...
    (microsoft.public.vb.general.discussion)
  • Re: Updating via internet
    ... Thank you very much for your reply Danny. ... At present, if I want to publish an update I vpn the server, copy across the ... Dir command to check for the presence of the new FE). ... You can do an FTP command to ...
    (comp.databases.ms-access)
  • Re: ftp via bat called by wsh
    ... > I cannot get the ftp command line to close when using MPUT - the ftp ... > command to upload multiple files. ... This is because the mput command is default interactive (it will ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.scripting.wsh)
  • Re: ftp command
    ... The "rcp -p -r" command might be better for copying files back and forth if the machines are local and whatnot. ... Bob Booth - UIUC ... interface than the 'stock' ftp command. ... > the process am losing the permissions. ...
    (AIX-L)
  • Re: Migrating me from linux/bsd to zOS
    ... Comparing JCL to *NIX commands? ... IKJ56802I COMMAND COPY NOT FOUND, ... For IBM-MAIN subscribe / signoff / archive access instructions, ... send email to listserv@xxxxxxxxxxx with the message: GET IBM-MAIN INFO ...
    (bit.listserv.ibm-main)