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

Query on Handling User and System abends


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

New User


Joined: 23 Apr 2009
Posts: 20
Location: India

PostPosted: Wed Jul 22, 2009 11:11 am
Reply with quote

Hi,

My requirment is tosend a notification mail to a set of people whenever an abend occurs in a job. To do this, my job should execute till the end even if a sytem abend or user abend occurs(other than the standard Maxcc 4, 8 12 and 16 abends). Is there a way to do it? Please help
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed Jul 22, 2009 4:49 pm
Reply with quote

There's a link to manuals at the top of the page. Have you researched this in the JCL Reference manual? Or any other manual?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jul 22, 2009 4:54 pm
Reply with quote

Quote:
(other than the standard Maxcc 4, 8 12 and 16 abends).

What is a MAXCC abend ?
Back to top
View user's profile Send private message
apvardhini

New User


Joined: 23 Apr 2009
Posts: 20
Location: India

PostPosted: Wed Jul 22, 2009 5:25 pm
Reply with quote

Hi,

I tried using the COND = (EVEN/ONLY) parameter in the EXEC Statement.
It seems EVEN/ONLY works only during an abend. When we encounter error codes like RC=8 or Rc=12 or RC=5, the EVEn/ONLY parameter fails to execute the step. Can anyone help?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jul 22, 2009 5:28 pm
Reply with quote

I suggest you read the JCL reference manual.
Click "IBM Manuals" at the top of the page, scroll down, and read.
Back to top
View user's profile Send private message
apvardhini

New User


Joined: 23 Apr 2009
Posts: 20
Location: India

PostPosted: Wed Jul 22, 2009 5:31 pm
Reply with quote

Yes, I read the Manual, and also found the below from the IBM website
Quote:
Example 1

//S5 EXEC PGM=R,COND=EVEN
//R8 EXEC PGM=S,COND=((5,LT),EVEN)
//S6 EXEC PGM=T,COND=ONLY
//CX EXEC PGM=U,COND=((4,GE,STEP3),(8,EQ,STEP2),ONLY,(12,LT,BX)) Example 2

//LATE EXEC PGM=CLEANUP,COND=EVEN This example says 'Execute program CLEANUP even if one or more of the preceding steps abnormally terminated.'

Example 3

//LATER EXEC PGM=SCRUB,COND=((10,LT,STEPA),(20,EQ),ONLY) This example says 'Execute this step only if one of the preceding steps terminated abnormally; but bypass it if 10 is less than the return code STEPA issues or if any of the steps that terminated normally issued a return code of 20'.

Example 4

//LATEST EXEC PGM=FIX,COND=((10,LT,STEPA),(20,EQ),EVEN) This example says 'Bypass this step if 10 is less than the return code STEPA issues, or if any of the preceding steps issues a return code of 20; otherwise execute this step even if one of the preceding steps terminated abnormally'.

Example 5

//EXG EXEC PGM=A1,COND=(EVEN,(4,GT,STEP3))
//EXH EXEC PGM=A2,COND=((8,GE,STEP1),(16,GE),ONLY)
//EXI EXEC PGM=A3,COND=((15,GT,STEP4),EVEN,(30,EQ,STEP7))


But in my case, I want to send a notification if there is an abend as well as if I encounter a error code such as RC=8 or RC=12.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jul 22, 2009 5:34 pm
Reply with quote

Then you need to use the appropriate test for COND= or take a look at IF/THEN/ELSE processing whici is more felible and easier to understand
Back to top
View user's profile Send private message
apvardhini

New User


Joined: 23 Apr 2009
Posts: 20
Location: India

PostPosted: Wed Jul 29, 2009 2:26 pm
Reply with quote

Lets say my job has 8 steps. The 5th step had return code 8 and the rest of the steps have return code zero. On my 7th step, I code the part to send mail in case of abends or errors.
//STEP07 EXEC PGM=IEBGENER, COND=((4,GT), EVEN)
//.....
//.....
//STEP8

But still I am not getting the notification mail.
Can anyone help?

I had a look into the IBM manual and the website as well but the program behaves in a way contradicting what they have given. This is how I understood the condition COND=((4,GT), EVEN)
"Bypass this step if 4 is greater than the return code issued by any other step. Otherwise execute this step even if there is any abnormal termination."

Please correct if I am wrong
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jul 29, 2009 2:51 pm
Reply with quote

Quote:
Please correct if I am wrong

OK, no problems ........................... here we go.

COND=(4,GT) checks to see if ANY previous step returns a code of 4 or less than 4.

If ANY step returns a code of 4 or less than 4 then the condition is met and the step will not run.

EVEN specifies that the step is to process EVEN if an abend occurs.

So where we have COND=((4,GT),EVEN) the step will not process EVEN if an abend occurs but ANY step has issued a return code of 4 or less than 4, because the conditions to bypass the step have been met.

Hence my suggestion that you look at IF/THEN/ELSE processing, which is easier to code and understand, and allows much more flexibility in coding.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jul 29, 2009 3:02 pm
Reply with quote

Since posting my reply, I have read the section regarding IF/THEN/ELSE and know exactly what you need to code to get the desired results.

The JCL REFERENCE manual is the one to read, and read, and read, until it sinks in and you know what to code.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Thu Jul 30, 2009 6:48 am
Reply with quote

To emphasize what expat has suggested several times, please consider using the IF/THEN/ELSE/ENDIF construct. The folks who maintain what you have written will be very grateful.
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 Sysplex System won't IPL at DR site I... All Other Mainframe Topics 2
No new posts RC query -Time column CA Products 3
No new posts PuTTY - "User is not a surrogate... IBM Tools 5
No new posts Dynamically pass table name to a sele... DB2 2
No new posts How to delete a user's alias from the... JCL & VSAM 11
Search our Forums:

Back to Top