View previous topic :: View next topic
|
Author |
Message |
Dinesh Manivannan
New User
Joined: 17 Mar 2008 Posts: 17 Location: India
|
|
|
|
Hi,
My requirement is to send mail to end user when any of the step fails in any proc of a job.
Ex: I have 3 procs which is called by single job. If any of the steps from any proc is abended I need to send mail.
I don't want to change the proc. Is there a way to check the return of a proc and send the mail to users accordingly.
Thanks in advance. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Procedures, catalogued or otherwise, don't have any sort of return/abend code in themselves. Each individual step in any procedure does.
Are you clear about what "abend" means? If so, have a look at COND=ONLY in the JCL Reference (link at the top of the page). |
|
Back to top |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
Hi Dinesh,
Please check this.
Code: |
//JOBB JOB ...
//STEP1 EXEC PROC1
//STEP2 EXEC PROC2
//STEP3 EXEC PROC3
//IFBAD IF (ABEND | RC > 0) THEN
//TRUE EXEC PROC=MAIL
// ELSE
//IFBADEND ENDIF |
|
|
Back to top |
|
|
Dinesh Manivannan
New User
Joined: 17 Mar 2008 Posts: 17 Location: India
|
|
|
|
Thanks Gnanaz. It worked. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Gnana's is a solution with much more control. Remember if you have steps which can produce a non-zero condition-code but that is OK, you need to handle that.
Also, make sure you read it up in the JCL reference, it may not operate how you feel it should: operator/user CANCEL; JCL error (initial, or during the job). So make sure you test things like that and don't just assume that it is "working".
You may find that your Scheduler can send e-mails, and this might give you better coverage of problems with the Job. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
Need to know the return code of cataloged procedure |
the question/title does not make any sense
the return code is returned by each STEP irrelevant of the way the step is executed....
plain jcl
inline proc
cataloged proc
nested proc
amen |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
And I always thought "fail" and RC>0 are not always same... |
|
Back to top |
|
|
|