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: 7315

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: 788
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: 7315

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: 10254
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 Job failing with USER = 4093 REASON C... Pradeepa S ABENDS & Debugging 1 Wed May 17, 2017 3:35 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts QUESTION: RETURN CHANNEL pahiker CA Products 21 Thu Apr 20, 2017 12:31 am
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm


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