Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Job Submission after the previous Job completed

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Job Submission after the previous Job completed
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10308
Location: italy

PostPosted: Wed Mar 12, 2008 3:19 pm    Post subject: Reply to: Job Submission
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: 1288
Location: Chennai, India

PostPosted: Thu Mar 13, 2008 5:06 am    Post subject: Reply to: Job Submission after the previous Job completed
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    Post subject:
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: 1703
Location: Australia

PostPosted: Thu Mar 13, 2008 8:19 am    Post subject:
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    Post subject: Reply to: Job Submission after the previous Job completed
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    Post subject: Re: Reply to: Job Submission after the previous Job complete
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: 1703
Location: Australia

PostPosted: Thu Mar 13, 2008 11:34 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts it is possible output a SET value fro... Martylin JCL & VSAM 5 Fri Sep 22, 2017 7:08 am
No new posts Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm
No new posts Need DB2 query to fetch previous row ! Chandan1993 DB2 10 Sat Jun 03, 2017 10:43 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts How to get previous month in SYMNAMES Suganya87 SYNCSORT 9 Fri Oct 28, 2016 1:37 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us