Submitting One Job after Previous Job has completed



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

Submitting One Job after Previous Job has completed

Postby anurag_87 » Mon Feb 06, 2012 5:09 pm

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
anurag_87
 
Posts: 7
Joined: Mon Feb 06, 2012 4:03 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Submitting One Job after Previous Job has completed

Postby BillyBoyo » Mon Feb 06, 2012 5:39 pm

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?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Submitting One Job after Previous Job has completed

Postby prino » Mon Feb 06, 2012 6:00 pm

Let job(n) trigger the submission of job(n+1)
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 635
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 28 times

Re: Submitting One Job after Previous Job has completed

Postby anurag_87 » Tue Feb 07, 2012 2:07 am

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.
anurag_87
 
Posts: 7
Joined: Mon Feb 06, 2012 4:03 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Submitting One Job after Previous Job has completed

Postby halfteck » Tue Feb 07, 2012 2:58 am

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.
halfteck
 
Posts: 42
Joined: Tue Nov 08, 2011 8:47 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Submitting One Job after Previous Job has completed

Postby anurag_87 » Tue Feb 07, 2012 3:19 am

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..
anurag_87
 
Posts: 7
Joined: Mon Feb 06, 2012 4:03 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Submitting One Job after Previous Job has completed

Postby Robert Sample » Tue Feb 07, 2012 4:00 am

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.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Submitting One Job after Previous Job has completed

Postby BillyBoyo » Tue Feb 07, 2012 4:17 am

JES2 or JES3?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Submitting One Job after Previous Job has completed

Postby Robert Sample » Tue Feb 07, 2012 4:20 am

Billyboyo, you're about to mention JES3 DJC, aren't you?
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Submitting One Job after Previous Job has completed

Postby BillyBoyo » Tue Feb 07, 2012 4:32 am

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Next

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post