Page 1 of 2

Submitting One Job after Previous Job has completed

PostPosted: Mon Feb 06, 2012 5:09 pm
by anurag_87
Hi All,
Can someone please tell me how to do submit a next JOB once previous JOB has completed.
I know it can be done very easily via Scheduler, but I wanna have it in our Test Lpar where we do not have scheduler.

Background:-
I wanna create a JCL which will execute 12 jobs using IEBGENER , INTRDR.
Sample step:-
TESTCS1 EXEC PGM=IEBGENER,COND=(0,LT)
SYSIN DD DUMMY
SYSPRINT DD SYSOUT=*
SYSUT1 DD DSN=XXXX.YYYYY(JCL1),DISP=SHR
SYSUT2 DD SYSOUT=(R,INTRDR)
**____________________________________________________________
TESTCS2 EXEC PGM=IEBGENER,COND=(0,LT)
SYSIN DD DUMMY
SYSPRINT DD SYSOUT=*
SYSUT1 DD DSN=XXXX.YYYYY(JCL2),DISP=SHR
SYSUT2 DD SYSOUT=(R,INTRDR)

Now what I want is once the JCL1 gets completed , JCL2 gets triggered.

At present both the JCL1 and JCL2 will get triggered simultaneously.

Regards
Anurag

Re: Submitting One Job after Previous Job has completed

PostPosted: Mon Feb 06, 2012 5:39 pm
by BillyBoyo
Have you talked to anyone at your site? Are others already doing something like this, so you can do it that way? Otherwise, have you talked to the technical staff who would be responsible for the day-to-day running of the machine. They probably have a preferred method. If they don't and they just want to let you loose with solutions from "out there" on the internet, have you googled? Searched this site?

Re: Submitting One Job after Previous Job has completed

PostPosted: Mon Feb 06, 2012 6:00 pm
by prino
Let job(n) trigger the submission of job(n+1)

Re: Submitting One Job after Previous Job has completed

PostPosted: Tue Feb 07, 2012 2:07 am
by anurag_87
Hi Billy,
I have googled it but did not get what i wanted..and as i mention, we have a scheduler using which I can easily have job submited anyways I want.But the problem is that scheduler is in our production MVS and I wanna setup this is Test LPAR which is a different MVS.Hence was looking for a solution to have above schedule

Hi Prino,
Thanks for the option,I will keep that as my last option if I could not get anything using which I can control all my jobs in a single job.

Re: Submitting One Job after Previous Job has completed

PostPosted: Tue Feb 07, 2012 2:58 am
by halfteck
you have 3 alternatives, he best choice is the 1 from prino.
Option 2, combine all the jobs as steps of 1 job in the order you want them run
Option 3, the worst, have all the jobs in 1 member, with the same jobname, they will run 1 after the other.
If you want to also avail yourself of condition codes, then definately use Prino's solution.

Re: Submitting One Job after Previous Job has completed

PostPosted: Tue Feb 07, 2012 3:19 am
by anurag_87
All
Thanks for the suggestions..
But I am not convinced to opt for these as of now.All seems to either tweak the existing JCL to have Job N to trigger Job N+1 or get all job submitted with same Jobname so that JES will execute only one at a time.
Above will solve the purpose no doubt.

But what I wanna understand is that do we have any process,may be thru INTRDR to have that control on trigger of next job or somthing else similar kinda..

Re: Submitting One Job after Previous Job has completed

PostPosted: Tue Feb 07, 2012 4:00 am
by Robert Sample
get all job submitted with same Jobname so that JES will execute only one at a time.
Be aware that this does NOT guarantee the jobs will run in the submitted sequence -- they may run in sequence of job 1, 3, 4, 2, 5, 9, 6, 8, 7, 10 for example.

You really have 3 choices:
1. Use a job scheduler. If one is not available in the LPAR you're running in, this option is out.
2. Add a step to the end of each job that copies the next job to the internal reader (INTRDR). This requires changing the JCL.
3. Manually submit the first job, watch until it finishes, then submit the second, etc.

Re: Submitting One Job after Previous Job has completed

PostPosted: Tue Feb 07, 2012 4:17 am
by BillyBoyo
JES2 or JES3?

Re: Submitting One Job after Previous Job has completed

PostPosted: Tue Feb 07, 2012 4:20 am
by Robert Sample
Billyboyo, you're about to mention JES3 DJC, aren't you?

Re: Submitting One Job after Previous Job has completed

PostPosted: Tue Feb 07, 2012 4:32 am
by BillyBoyo
Robert, I'm not going to mention anything if they have JES2 :-)

I was thinking of NJE. I was going to check it still existed before mentioning it. Maybe DJC is something fancier and more suitable these days? It used to be fun to watch a big "network" fire up on our "repeater" console.