MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PROC STEP WITH EMAIL FOR FAILURE

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
newcobol
Beginner


Joined: 20 Apr 2006
Posts: 88
Topics: 22

PostPosted: Fri Jan 23, 2015 3:57 pm    Post subject: PROC STEP WITH EMAIL FOR FAILURE Reply with quote

I want a step to execute only if a step prior to it has an error(code > 4)
i think this should work except there are multiple steps, and if one of them finishes ok, this step wont execute even if another step abends.
does anyone know the syntax

Code:

//********************************************************************
//* SEND E-MAIL IF NOT OK
//********************************************************************
//STEP180   EXEC PGM=ZADPR01,COND=(5,GT)
//EMAILKEY  DD DSN=&KEYSLIB(CACRKF05),DISP=SHR
//EMAIL01   DD DSN=&KEYSLIB(CACRKF06),DISP=SHR
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Fri Jan 23, 2015 5:10 pm    Post subject: Reply with quote

newcobol,

By now you should be able to use CODE tags. Check this link to learn about code tags

http://www.mvsforums.com/helpboards/viewtopic.php?p=19031#19031

AFAIK cond works as an AND condition. You need an OR condition which accounts for a return code greater 4 for any of the steps or an abend in any of the steps. You need to use IFTHEN construct.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Fri Jan 23, 2015 5:16 pm    Post subject: Reply with quote

Try:
Code:
//         IF (RC GT 0004) THEN
//********************************************************************
//* SEND E-MAIL IF NOT OK
//********************************************************************
//STEP180   EXEC PGM=ZADPR01
//EMAILKEY  DD DSN=&KEYSLIB(CACRKF05),DISP=SHR
//EMAIL01   DD DSN=&KEYSLIB(CACRKF06),DISP=SHR
//         ENDIF

_________________
....Terry
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Fri Jan 23, 2015 5:32 pm    Post subject: Reply with quote

Terry_Heinze,

I believe you the step will NOT execute if any of the previous steps abended. So I guess OP needs

Code:

//         IF (RC GT 0004 OR ABEND) THEN

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group