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

How to find the result of one Job


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

New User


Joined: 02 Aug 2003
Posts: 5

PostPosted: Tue Nov 15, 2005 12:03 pm
Reply with quote

I have the requirements..

I want to run a "JOB C". But the condition is "JOB A" & "JOB B" should be completed successful. Then only i can run my "JOB C".

So how to find out in JCL for the completion of other jobs.

Anykind of Suggession or Help are most welcomed....

Thanks in Advance,
MR
Back to top
View user's profile Send private message
Prasanthhere

Active User


Joined: 03 Aug 2005
Posts: 306

PostPosted: Tue Nov 15, 2005 2:29 pm
Reply with quote

By using condition in the Job statement

Correct me if i am wrong?????
Back to top
View user's profile Send private message
gr_mohanram

New User


Joined: 02 Aug 2003
Posts: 5

PostPosted: Tue Nov 15, 2005 2:45 pm
Reply with quote

Your answer might be correct but my question is how to check it in JCL? (ie.) i want a JCL syntax to find the return code of some other job???
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Tue Nov 15, 2005 3:11 pm
Reply with quote

Dont know how to trap condition codes from one job to others.

But your main requirement of running third job only on completion of the previous two can be achieved by some schedular tool like CA-7.

Regards,

Priyesh.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Nov 15, 2005 10:34 pm
Reply with quote

I agree with the above recommendations that you should be using a job scheduler for this process.

However, outside of that, I can think of two options:

1. Why not just have JOBA and JOBB each catalog a dataset when they end, indicating the final status of the job. Then, have JOBC check for the existence of valid data in BOTH datasets before it can continue.

2. Make use of the TSO OUTPUT command to retrieve the output of both JOBA and JOBB from the JES Held Output Queue:

Code:

//STEP0001 EXEC PGM=IKJEFT01                                       
//SYSTSPRT DD   SYSOUT=*                                           
//SYSTSIN  DD   *                                                 
OUTPUT JOBA PRINT(JOBA.JOB) BEGIN HOLD KEEP               
OUTPUT JOBB PRINT(JOBB.JOB) BEGIN HOLD KEEP               
/*                                                                 
//*                                                               
//STEP0002 EXEC PGM=SORT                                           
//SORTIN   DD   DISP=SHR,DSN=&SYSUID..JOBA.JOB.OUTLIST         
//         DD   DISP=SHR,DSN=&SYSUID..JOBB.JOB.OUTLIST         
//SORTOUT  DD   SYSOUT=*                                           
//SYSOUT   DD   SYSOUT=*                                           
//SYSIN    DD   *                                                 
  OPTION COPY                                                     
  OUTFIL INCLUDE=(2,7,CH,EQ,C'IEF142I'),                           
    OUTREC=(2,80)                                                 
/*                                                                 
Back to top
View user's profile Send private message
shailen

New User


Joined: 27 Mar 2004
Posts: 22

PostPosted: Wed Nov 16, 2005 12:33 am
Reply with quote

Hi,

If you think tool like CA7 is useful then 2 lines will work healthy.

DEMAND,JOB=JOBC,DEPJOB=JOBA
ADDRQ,JOB=JOBC,DEPJOB=JOBB

Thanks
Back to top
View user's profile Send private message
gr_mohanram

New User


Joined: 02 Aug 2003
Posts: 5

PostPosted: Wed Nov 16, 2005 9:26 pm
Reply with quote

Thanks a lot for your updates...!!!
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 To find whether record count are true... DFSORT/ICETOOL 6
No new posts Find the size of a PS file before rea... COBOL Programming 13
No new posts first column truncated in search result IBM Tools 13
No new posts SDSF like solution in EJES (store com... All Other Mainframe Topics 4
No new posts executing XCTL command in COBOL witho... CICS 10
Search our Forums:

Back to Top