View previous topic :: View next topic |
Author |
Message |
newcobol Beginner
Joined: 20 Apr 2006 Posts: 88 Topics: 22
|
Posted: Fri Jan 23, 2015 3:57 pm Post subject: PROC STEP WITH EMAIL FOR FAILURE |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Fri Jan 23, 2015 5:10 pm Post subject: |
|
|
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 |
|
|
Terry_Heinze Supermod
Joined: 31 May 2004 Posts: 391 Topics: 4 Location: Richfield, MN, USA
|
Posted: Fri Jan 23, 2015 5:16 pm Post subject: |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Fri Jan 23, 2015 5:32 pm Post subject: |
|
|
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 |
|
|
|
|