How to trigger a jcl from a windows .bat file?



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

How to trigger a jcl from a windows .bat file?

Postby chandra 2185 » Fri Jun 29, 2012 9:48 am

Hi,

My case is to trigger a job on the mainframe when the user clicks a .bat file script to perform some activity. How can I do this. This is very urgent I have a user demo coming up. Please share asap and the help is highly appreciated.

Thanks.
chandra 2185
 
Posts: 17
Joined: Mon Jun 18, 2012 2:30 am
Has thanked: 0 time
Been thanked: 0 time

Re: How to trigger a jcl from a windows .bat file?

 

Re: How to trigger a jcl from a windows .bat file?

Postby NicC » Fri Jun 29, 2012 12:17 pm

Do not ask for urgent requests on a forum. People here answer on their own time and if they feel inclined to. If you want urgent then pay someone to come in. Or ask the people who are likely to know - those in your own company like your network people and scheduling people.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: How to trigger a jcl from a windows .bat file?

Postby Robert Sample » Fri Jun 29, 2012 2:36 pm

What does "trigger a job" mean -- the term is usually used with a job scheduler such as Tivoli or CA-7, and you would have to find the manuals at your site for whichever product you have, review the API documentation, and determine whether or not what you want to do can even be done with the product, period.? A PC can submit a job on a mainframe by using FTP into JES, but that's about as much as can be done from a PC.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: How to trigger a jcl from a windows .bat file?

Postby dick scherrer » Fri Jun 29, 2012 7:34 pm

Hello,

Does the pc process also send a file to the mainframe?

If it does and there is scheduling software running on the mainframe, the schedule can submit a job when the file arrives on the mainframe.

If the pc process does NOT send a file, suggest you do as Robert said and use FTP to present the job to the mainframe.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: How to trigger a jcl from a windows .bat file?

Postby chandra 2185 » Fri Jun 29, 2012 7:41 pm

Hi Robert,

I am looking to make pc to submit a job to the mainframe. Any sample scripts would help me. I think this would solve my purpose. Thanks in advance.
chandra 2185
 
Posts: 17
Joined: Mon Jun 18, 2012 2:30 am
Has thanked: 0 time
Been thanked: 0 time

Re: How to trigger a jcl from a windows .bat file?

Postby Robert Sample » Fri Jun 29, 2012 8:31 pm

If your Windows FTP command file contains
QUOTE SITE FILETYPE=JES
then your transmitted data will be submitted to JES as a job rather than stored as a file.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: How to trigger a jcl from a windows .bat file?

Postby chandra 2185 » Fri Jun 29, 2012 9:49 pm

Hi Robert,

Thank you. But then do I have to have a jcl in the script which again going to invoke the actual. I mena i have to use the intrdr iebedit to invoke my jcl. from the script.
chandra 2185
 
Posts: 17
Joined: Mon Jun 18, 2012 2:30 am
Has thanked: 0 time
Been thanked: 0 time

Re: How to trigger a jcl from a windows .bat file?

Postby Robert Sample » Fri Jun 29, 2012 9:54 pm

When you FTP to JES, you are sending JCL to execute a job, which means that JCL has to be part of the Windows script that starts up the FTP. What program(s) that job executes once the JCL is submitted depends upon you and what you want the job to do.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: How to trigger a jcl from a windows .bat file?

Postby Ed Goodman » Fri Jun 29, 2012 10:29 pm

If you use the PUT command after switching to JES, then you need to have the full job on the PC. The Put command will take that text file and submit it to the INTRDR. You get back the name/number of the job which was submitted. The PUT command does NOT wait for the job to finish.

If you use the GET command after switching to JES, then it will find a file on the mainframe that is already there and submit THAT to the INTRDR. It will wait for the job to finish until the FTP time out is reached.

If you want to see the status of a running job, you can use the DIR command after switching to JES. The jobnum parm gives you some filtering.

I've used both ways, and I like the PUT option because if frees up the connection immediately. What I do is build the job on the PC, then send that job to a mainframe member, then switch to JES and submit it and grab the job num. Then I have my PC app do occasional DIRs on that job num to get the status. Then I do a GET on the Jobnum to read the job output into a file on the PC, then parse that file for the results.

It sounds worse than it is. I have a reusable Delphi unit with the steps in it and just plug it in as needed.
Ed Goodman
 
Posts: 342
Joined: Thu Feb 24, 2011 12:05 am
Has thanked: 3 times
Been thanked: 17 times

Re: How to trigger a jcl from a windows .bat file?

Postby chandra 2185 » Sat Jun 30, 2012 12:16 am

Robert Sample wrote:When you FTP to JES, you are sending JCL to execute a job, which means that JCL has to be part of the Windows script that starts up the FTP. What program(s) that job executes once the JCL is submitted depends upon you and what you want the job to do.


Hi Robert,

This is the code i have in the .bat file but when i exceute it i dont see anything happening can you please guide me.
the code is:
ftp
ftp
open ip address
user
pwd
jcl the sample looks like this
//IEBEDITA JOB (XXXXXXXX,,,,,XXXX),' ',CLASS=T,
// MSGCLASS=Y,NOTIFY=&SYSUID
//*===========================================================
//* EXAMPLE FOR IEBEDIT UTILITY
//*===========================================================
//STEP001 EXEC PGM=IEBEDIT
//SYSUT1 DD DSN=USERID.ABC.JCLLIB(JOBNAM1),DISP=SHR
//SYSUT2 DD SYSOUT=(*,INTRDR)
//SYSPRINT DD SYSOUT=*
//*
//
close
quit
in the above the job - jobnam1 is the actual that can excute the pgm tat i wanted to but the jcl mentioned in the script is used to invoke that jcl from jes. Please help where I am going wrong.
Thanks.
chandra 2185
 
Posts: 17
Joined: Mon Jun 18, 2012 2:30 am
Has thanked: 0 time
Been thanked: 0 time

Next

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post