[SOLVED] mainframe jcl -- control order of when jobs run
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
hi, we have been using zeke to schedule 108 jobs but it is starting to be a pain in my ass (it is far more complicated and far less capable than cron).
so i did a few google/duckduckgo searches and i took the initiative to modify the ends of the jobs to look like this:
Code:
// IF RC=0 THEN
//STEP1 EXEC PGM=IKJEFT01
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
SUB R15UXB.X390.BANKCODE.JCLLIB.NEW(X390T123)
//ENDIF
the problem i have now is that i want 2 jobs to run at the same time and i want the next job to run when both jobs finish.
kinda' like using & and the wait command in bash ?
[Off Topic] No help for the OP, but for others reading this, Dillon's cron, which is Slackware's default cron daemon, can do this. It is a light-weight cron daemon with some surprisingly smart and useful tricks.
It has been decades since I used in-line TSO commands. If IKJEFT01 supports the OPER command and OPER supports a reasonable set of console commands then you can do what you want this way:
You have jobs A, B, C, and D
Job A submits jobs B, C, and D. B and C are submitted to be immediately runnable. D is submitted at priority 0 and also held.
The last step in job B runs OPER under IKJEFT01 to release job D.
The last step in job C runs OPER under IKJEFT01 to set job D to normal priority.
Back in the day I used have my JCL clerks do this sort of thing using a home grown program which entered operator commands. It is not that difficult to write. If the set of allowable OPER subcommands is not rich enough to do what you want I suggest you roll your own version of a job stream OPER.
For anything more complex than serial chaining of jobs, your best bet is to use the scheduling software provided on the mainframe. The scheduling software does more than just submit jobs to the system. It also allows you to define the dependencies between jobs and define the success criteria that allows a dependent job to be triggered. You have a job that has a dependency on the successful completion of two other jobs that you want to run concurrently. That is what the scheduling system is there for. I don't have any experience with Zeke, but you should be able to get help from someone who works with batch job scheduling on the mainframe.
If your job log has IAT messages in it, the system is using JES3. If you see $HASPnnn messages, it's JES2. JES2 is far more common than JES3. If the job entry subsystem is JES3, you can try defining a dependent job control (DJC) net. JES2 doesn't support DJC. Even on a JES3 system, DJC may not be enabled. Google it and refer to the IBM manuals if you have JES3.
To serially chain jobs so that one runs immediately after another, your technique using TSO SUBMIT from a batch terminal monitor program (IKJEFT01, IKJEFT1A, IKJEFT1B) might work, but SUBMIT is often subject to installation defined controls imposed via an installation exit. A slightly more generic method is to use IEBGENER and output the next job in the chain directly to an internal reader.
It can include a step to submit the next job in the chain, and so on.
There are games you can play with enqueued data sets to help serialize jobs, but the systems programmers won't like it if you have jobs tying up initiators waiting for a data set to become available.
If you have SDSF, and if you have the requisite authority, you could submit all your dependent jobs on hold as jailbait said, and then use SDSF in batch to find and release them as needed.
But honestly, I'd suggest you make friends with someone in the batch scheduling group and learn how to use your scheduling system.
By the way, cron is available on the mainframe under Unix Systems Services. USS is ignored or minimally configured on very many z/OS systems, so cron may not be set up. Even if it is, you may not have authority to use it. But it's worth checking. If you can login to a TSO account on the mainframe, the OMVS command will get you to a command line prompt, provided you've been given a Unix uid and gid on the mainframe. Telnet or ssh may be enabled, so you could try those to get to a native Unix command line.
If the mainframe system is z/OS 1.9 or later, SDSF supports a Rexx interface that you could use to write your own job scheduler. Rexx is an interpreted high-level programming language. It's very powerful, but like any language, you'll have to invest some effort into learning it.
For anything more complex than serial chaining of jobs, your best bet is to use the scheduling software provided on the mainframe. The scheduling software does more than just submit jobs to the system. It also allows you to define the dependencies between jobs and define the success criteria that allows a dependent job to be triggered. You have a job that has a dependency on the successful completion of two other jobs that you want to run concurrently. That is what the scheduling system is there for. I don't have any experience with Zeke, but you should be able to get help from someone who works with batch job scheduling on the mainframe
...
But honestly, I'd suggest you make friends with someone in the batch scheduling group and learn how to use your scheduling system.
good point. not to bore you with the corperate politics but the person ive been working with is now billable. i know that posix is different from z/os-mvs but i find it frustrating that a 4 letter bash command requires billable hours to be done on the mainframe.
Quote:
Originally Posted by Z038
By the way, cron is available on the mainframe under Unix Systems Services. USS is ignored or minimally configured on very many z/OS systems, so cron may not be set up. Even if it is, you may not have authority to use it. But it's worth checking. If you can login to a TSO account on the mainframe, the OMVS command will get you to a command line prompt, provided you've been given a Unix uid and gid on the mainframe. Telnet or ssh may be enabled, so you could try those to get to a native Unix command line.
i tried running omvs from the ispf command shell and it shows me copyright/trademark notices from ibm then the last line says -- the session has ended. press enter to end omvs.
When you say "ispf command shell", you don't mean ish or ishell, the ISPF shell panel do you? That's a weird interface. I wouldn't suggest using it. Normally you enter OMVS from a TSO line mode READY prompt, from ISPF option 6, or by entering TSO OMVS from a command line on just about any ISPF screen.
But based on your results, I suspect the problem is that there is no Unix uid/gid defined for your userid. If your security system is RACF, you need to have the security folks define an OMVS segment for you. (Billable, no doubt.) That is where your uid, gid, shell, and home directory get defined.
i am now submitting jobs via bash from the unix system using ftp(messy hack -- i hate having passwords written in a script. wish there were ssh keys for mainframe).
after issuing quote site FILE=JES i can upload the jcl and it automatically runs. now the script sleeps for 3600 seconds (1 hour) between jobs. but some jobs finish in a few minutes (1 of them takes longer than an hour sometimes).
is there a way to know when a job completes via ftp ?
There are a couple of SSH options available for the z/OS mainframe, but they may not be set up at your shop. IBM has a port of openssh available that can run under Unix Systems Services on z/OS. It's not installed or configured by default. Tectia has a mainframe ssh server product, and there are a couple of others out there. But none of that helps you if it's not available on your mainframe.
FTP can't initiate a shell script on the Unix/Linux side, but z/OS does have a native rexec client that can initiate a script via your rexecd server, if you are running one. rsh is also available.
You could add a final job step to your mainframe batch job to invoke rexec, if you are running the rexec server on the *nix side. If you don't, then your final step could ftp a file to your Linux system, and you could watch for it via the inotify interface.
This is about as bizarre a thread as I would expect to see here. You can submit JCL and get the output back automatically; see here.
I might expect this from a (z)linux instance - but I guess you could do it from OMVS.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.