Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Need to know the return code of cataloged procedure

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Dinesh Manivannan

New User


Joined: 17 Mar 2008
Posts: 16
Location: India

PostPosted: Mon Feb 27, 2012 2:35 pm    Post subject: Need to know the return code of cataloged procedure
Reply with quote

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
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Mon Feb 27, 2012 2:54 pm    Post subject: Reply to: Need to know the return code of cataloged procedur
Reply with quote

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
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 785
Location: Chennai, India

PostPosted: Mon Feb 27, 2012 2:56 pm    Post subject: Reply to: Need to know the return code of cataloged procedur
Reply with quote

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
View user's profile Send private message
Dinesh Manivannan

New User


Joined: 17 Mar 2008
Posts: 16
Location: India

PostPosted: Mon Feb 27, 2012 3:13 pm    Post subject:
Reply with quote

Thanks Gnanaz. It worked.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Mon Feb 27, 2012 3:27 pm    Post subject: Reply to: Need to know the return code of cataloged procedur
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10210
Location: italy

PostPosted: Mon Feb 27, 2012 3:56 pm    Post subject: Reply to: Need to know the return code of cataloged procedur
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Senior Member


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

PostPosted: Mon Feb 27, 2012 5:48 pm    Post subject:
Reply with quote

And I always thought "fail" and RC>0 are not always same... icon_exclaim.gif
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 How to Capture the Max return code of... anilkumar922 All Other Mainframe Topics 0 Thu Jan 12, 2017 12:02 pm
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us