View previous topic :: View next topic
|
Author |
Message |
navita
New User
Joined: 13 Apr 2009 Posts: 2 Location: pune
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
navita
New User
Joined: 13 Apr 2009 Posts: 2 Location: pune
|
|
|
|
true
but we wont have much work in maintainence projects, if it wasnt for bad designs |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
navita wrote: |
true
but we wont have much work in maintainence projects, if it wasnt for bad designs |
But then, the client would not have to pay for the inefficiencies of others |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Gousiya Mulla
New User
Joined: 02 Jun 2008 Posts: 87 Location: Bangalore
|
|
|
|
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 |
|
|
jsathishbabu84
New User
Joined: 07 Jun 2007 Posts: 22 Location: India
|
|
|
|
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 |
|
|
|