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

Need to know the return code of cataloged procedure


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

New User


Joined: 17 Mar 2008
Posts: 17
Location: India

PostPosted: Mon Feb 27, 2012 2:35 pm
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Feb 27, 2012 2:54 pm
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: 792
Location: Chennai, India

PostPosted: Mon Feb 27, 2012 2:56 pm
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: 17
Location: India

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

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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Feb 27, 2012 3:27 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Feb 27, 2012 3:56 pm
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

Superior Member


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

PostPosted: Mon Feb 27, 2012 5:48 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
Search our Forums:

Back to Top