View previous topic :: View next topic
|
Author |
Message |
Zain
New User
Joined: 29 Aug 2007 Posts: 3 Location: Chennai
|
|
|
|
We would like to submit jobs A & B and only hen both jobs complete Job 'C' has to run. Is there any way we can determine both jobs have completed? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
id You have a scheduler it would be safer to use it
otherwise the best thing is to have the run in sequence and
each job submit it' s own successor
submit JOB A
the last step should submit JOB B
and so on |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Zain,
In addition to what enrico said, you can create a REXX program to submnit the first 2 jobs and keep monitoring it till the job gets over. Once the job gets over, you can submit the last job.
But the best way is to add a step at the end of each job to submit the next job. You can use TSO in batch. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Quote: |
keep monitoring it till the job gets over |
What a waste of resources. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
here is another suggestion.
submit jobs A & B
on completion of job A, job A is to submit another job, say A1
on completion of job B, job B is to submit another job, say B1
Jobs A1 and B1 should update a a file.
A1 updates the file to flag job A has completed. a simple Y in byte 1 of the file will be sufficient. likewise B1 should update the file, a Y in byte2
Step2 in both jobs A1 and B1 can run a search on the file and if YY is encountered then submit job C
The code may explain it a little better
JOB A
Code: |
//STEP1 EXEC PGM=IEFBR14
//*
//SUBMIT EXEC PGM=IEBGENER
//SYSUT1 DD DSN=jcl library(A1),DISP=SHR
//SYSUT2 DD SYSOUT=(A,INTRDR)
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
|
JOB B
Code: |
//STEP1 EXEC PGM=IEFBR14
//*
//SUBMIT EXEC PGM=IEBGENER
//SYSUT1 DD DSN=jcl library(B1),DISP=SHR
//SYSUT2 DD SYSOUT=(A,INTRDR)
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
|
JOB A1
Code: |
//UPD EXEC PGM=FILEAID
//SYSPRINT DD SYSOUT=*
//DD01 DD DSN=file to be updated,DISP=OLD
//SYSIN DD *
*
$$DD01 UPDATE REPL=(01,C'Y')
/*
//**********************************************************************
//*
//SEARCH EXEC PGM=ISRSUPC,PARM=(SRCHCMP,'ANYC')
//NEWDD DD DSN=updated file,DISP=OLD
//OUTDD DD SYSOUT=*
//SYSIN DD *
SRCHFOR 'YY',01:02
/*
//*********************************************************************
//CHECK01 IF (SEARCH.RUN)
// & (SEARCH.RC = 1) THEN
//*
//SUBMIT EXEC PGM=IEBGENER
//SYSUT1 DD DSN=jcl library(C),DISP=SHR
//SYSUT2 DD SYSOUT=(A,INTRDR)
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
/*
//*********************************************************************
//CHECK01 ENDIF
|
JOB B1
Code: |
//UPD EXEC PGM=FILEAID
//SYSPRINT DD SYSOUT=*
//DD01 DD DSN=file to be updated,DISP=OLD
//SYSIN DD *
*
$$DD01 UPDATE REPL=(02,C'Y')
/*
//**********************************************************************
//*
//SEARCH EXEC PGM=ISRSUPC,PARM=(SRCHCMP,'ANYC')
//NEWDD DD DSN=updated file,DISP=OLD
//OUTDD DD SYSOUT=*
//SYSIN DD *
SRCHFOR 'YY',01:02
/*
//*********************************************************************
//CHECK01 IF (SEARCH.RUN)
// & (SEARCH.RC = 1) THEN
//*
//SUBMIT EXEC PGM=IEBGENER
//SYSUT1 DD DSN=jcl library(C),DISP=SHR
//SYSUT2 DD SYSOUT=(A,INTRDR)
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
/*
//*********************************************************************
//CHECK04 ENDIF
|
Gerry |
|
Back to top |
|
|
bharath18
New User
Joined: 12 Sep 2006 Posts: 15 Location: Chennai, Tamilnadu, India
|
|
|
|
Instead of the above one to submit four jobs one by one, i hope the below one would be more easier,
If you submit JOB A it will take care of the submission of JOB B & JOB C, see the code in attachment.
Even if you have further specific things to be done, you can use CA7 scheduler, as to schedule to run JOB A by A time and then let it trigger JOB B and then the same to JOB C.
Is your query solved ?
Thanks,
BS |
|
Back to top |
|
|
bharath18
New User
Joined: 12 Sep 2006 Posts: 15 Location: Chennai, Tamilnadu, India
|
|
|
|
NOTE : COND code is the difference making to prior one. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
I see lot's of suggestions, the single stream approach is the simplest of them all ie. Job A runs and the last step in this job submits Job B,
the last step in JOB B submits Job C.
I don't think this is what the original request asked for, I may be wrong but I think jobs A & B are submitted simultaneously and job C is to run after both jobs have completed successfully.
Running the jobs single stream could hours to the overall runtime.
Gerry |
|
Back to top |
|
|
|