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

STOP a job from triggering another job


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

New User


Joined: 13 Apr 2009
Posts: 2
Location: pune

PostPosted: Mon Apr 13, 2009 1:27 pm
Reply with quote

Hi,

Trigger a JCL

I am using CA7, but I want to do the opposite..ie, STOP a job from triggering another job.
Details: Job A generates a file x, and then triggers job B.
but if there is some problem with this file, then job B abends.
I want to stop job B from executing if there is some problem with the header/trailer of file x, or if file x is not present ( which happens sometimes).
But CA7 automatically triggers job B after job A.
And I dont want to make any changes in CA7,
so is there a way to stop job B from getting executed if job A failed to create the file, through JCL only?
thanx a lot.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Apr 13, 2009 1:32 pm
Reply with quote

Probably just another example of bad design.

If JOB1 had proper control checking then JOB1 would abend / issue a return code which would automatically stop JOB2 from processing.
Back to top
View user's profile Send private message
navita

New User


Joined: 13 Apr 2009
Posts: 2
Location: pune

PostPosted: Mon Apr 13, 2009 1:42 pm
Reply with quote

true icon_smile.gif

but we wont have much work in maintainence projects, if it wasnt for bad designs icon_smile.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Apr 13, 2009 3:52 pm
Reply with quote

Hi,

If I understood correctly - Job B is Data-set (X) triggered JOB, and X is created in Job A?

You can create one more job, Job X, which can be used as predecessor of Job B but successor of JOB A. Once Job A creates DSN "X", "perform" (using COBOL or SORT or . . .) all the "checks" on this DSN which you want to before initiating Job B or instead of this new Job X, Job A can be modified to have the functionalities of Job X.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Apr 13, 2009 3:55 pm
Reply with quote

navita wrote:
true icon_smile.gif
but we wont have much work in maintainence projects, if it wasnt for bad designs icon_smile.gif

But then, the client would not have to pay for the inefficiencies of others icon_evil.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Apr 14, 2009 2:58 am
Reply with quote

Hello,

Quote:
but we wont have much work in maintainence projects, if it wasnt for bad designs
Opinions vary . . .

If it wasn't for poor design, more time could be spent providing functions of value rather than trying to survive a poor implementation. . .

And if things seem "poorly done" now sometimes, just wait a few more years as an increasing number of systems are being written/maintained by people who do not understand the business processes for the application, do not understand the technology used, and believe major parts of a system should be implemented "with a JCL".
Back to top
View user's profile Send private message
Gousiya Mulla

New User


Joined: 02 Jun 2008
Posts: 87
Location: Bangalore

PostPosted: Wed Apr 15, 2009 3:19 pm
Reply with quote

Hi ,

You can opt for the below :

> Run (or ask your support team) the job B based on the RC (Return Code) of the job A . You need to set OPC or CA7 variables/parameters for this in your JCLs .

> Else you can have manual hold on the job B and release it once the Job A but this is not an efficient option since the manual interaction is needed which is not recommended we are having other options .

Hope This helps ...!!!
Back to top
View user's profile Send private message
jsathishbabu84

New User


Joined: 07 Jun 2007
Posts: 22
Location: India

PostPosted: Mon Apr 20, 2009 3:51 pm
Reply with quote

Hi,

In Job A, write a program to give a return code when the file X generated in the job is invalid (Invalid Header/Trailer) or see if u can achieve it using Sort.

Using the return code of the above step, Trigger the next job.
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 get the message id thats trigg... Java & MQSeries 0
No new posts TWS - ETT File triggering does not wo... IBM Tools 4
No new posts How to stop a runaway CICS trans with... CICS 13
No new posts Query regarding STOP REGION XX ABDU... IMS DB/DC 11
This topic is locked: you cannot edit posts or make replies. Data Sets are files. Please stop str... JCL & VSAM 11
Search our Forums:

Back to Top