Executing JCL through UNIX

Hi,

I am trying to execute a JCL in mainframe through solaris but it doent seem to work.

I have used the following script on a suggestion

#!/bin/ksh
ftp -n << EOF
open <servername>
user <userid> <password>
ascii
site file=jes
put <JCLfilename>
quit
EOF

It requires the JCL file to be in the dir from which I am executing this script which is ok. However the comman "site file" just does not work. iT says unrecognized command.
Though the above does FTP the file to mainframe system but it does not "submit" the JCL which is what I want.

Is there anyother way that I can achieve this?

Thanks
Manish

So you mainframe speaks TCP; you don't have to use SNA? Lucky you...

The site file has to be a valid "path" that you have access rights to as well. What errors are you seeing errors on the mainframe side?

Cheers,

Keith

ftp is just a way to transfer files. I don't understand why you expect it to run stuff.

We use ftp to our mainframe, but it just transfers files back and forth.

You might try:
site help
to see what site commands the server supports.

I'm not entirely surprised, but I am surprised that you are able to remotely FTP to the Mainframe. I was hard pressed to find many sites that allow their mainframes to be controlled remotely; and further more from a simple FTP script too.

I've worked at a number of mainframe sites that support TCP/IP. And at all of them, the mainframe dictates what goes in or out. So if you wish to upload JCL and execute it, then get yourself a logon and create your own JCL to upload and execute. It's nothing more than a security issue.

You'll find benefits in maintaining a dataset on the mainframe for just these types of uploads, now and in the future. It is also makes what you do on the mainframe more accountable. At the site I work at currently, we FTP everything from a downloade of simple report files to the uploading and compiling of source file. All controlled from the mainframe.

Best of luck to you.

Well yes the FTP works fine....and It should because the script logs on to MF server and FTPs the file there. What doesnt work is the command "site file".
MF is not recognizing this command and I was exepcting this to SUBMIT the JCL once its been FTPd.
The help gives me the following:
----
SIte subcommand--Send site-specific information to a host

Purpose

Use the SIte subcommand to send information that is used by the remote
host to provide services specific to that host system.
---

The error i get is "?Invalid command"!

Usually I use connectdirect to FTP my files to MF, this is something new I was trying. and this FTP workd and did FTP the file onto MF.

Site File should work if I give it directly on MF, as described in the help. This script should logon remotely to MF and execute this command. This is what is not happening.

I will see if something else works, if it does, will post back.

Thanks

Interesting thought process. I imagine that the SItecommand is ftp MF specific. I've always used ConnectDirect as well for such tasks and hadn't seen the other (having to go through an SNA gateway). Browsing the web I found references that indicated that before placing the file you had to state:

quote site filetype=jes

in order to have it interpreted as a JCL. The idea looks the same with a slightly different syntax. Unfortunately I have to MF to test it on.

Cheers,

Keith

Hey Kduffin......this worked!
The syntax I was using was wrong.
With this it worked fine.

I created a jcl file and stored it in UNIX, the work of this jcl file was to send an email to me through MF once submitted. Then I used the script i mentioned above, with the syntax mod that you had mentioned, and I got the mail from MF, it worked.

:slight_smile:

Thanks

If you have ConnectDirect available to you then you should be using that to transfer your files! CD is a secure facility for file transmission, plus you can easily accomplish the task of executing your JCL via the sysopts parameter. Not only can you specify an MVS job to execute with this parm, you can actually pass a set of commands as well. Connect Direct works in this manner for MVS, WiNT, and UNIX systems.

Hi Google,

I use CD to FTP data files to MF and then submit JCLs in MF which work on this data file.
Can you give me an example how I can submit a JCL using CD?

What I still havent been able to figure out is that how can I submit an existing JCL on MF.
The script that I have in my mails, requires the JCL to be present in UNIX dir, it then FTPs this JCL to MF and submits it. However if I already have a JCL in MF and just want to execute it in MF through unix, I havent found any way to do that.