IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Job Submission after the previous Job completed


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Zain

New User


Joined: 29 Aug 2007
Posts: 3
Location: Chennai

PostPosted: Wed Mar 12, 2008 3:09 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Mar 12, 2008 3:19 pm
Reply with quote

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
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Thu Mar 13, 2008 5:06 am
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Mar 13, 2008 8:16 am
Reply with quote

Quote:
keep monitoring it till the job gets over


What a waste of resources.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Mar 13, 2008 8:19 am
Reply with quote

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
View user's profile Send private message
bharath18

New User


Joined: 12 Sep 2006
Posts: 15
Location: Chennai, Tamilnadu, India

PostPosted: Thu Mar 13, 2008 11:14 am
Reply with quote

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
View user's profile Send private message
bharath18

New User


Joined: 12 Sep 2006
Posts: 15
Location: Chennai, Tamilnadu, India

PostPosted: Thu Mar 13, 2008 11:16 am
Reply with quote

NOTE : COND code is the difference making to prior one.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Mar 13, 2008 11:34 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to extract the data for current y... DFSORT/ICETOOL 8
No new posts To get previous month from current ti... SYNCSORT 7
No new posts Write a current record plus previous ... DFSORT/ICETOOL 4
No new posts How to append Previous date into a S... JCL & VSAM 2
No new posts Execute step regardless of previous s... JCL & VSAM 2
Search our Forums:

Back to Top