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
 

 

Query on Handling User and System abends

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Query on Handling User and System abends
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: 7931
Location: Bellevue, IA

PostPosted: Wed Jul 22, 2009 4:49 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 22, 2009 4:54 pm    Post subject:
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    Post subject: Reply to: Query on Handling User and System abends
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 22, 2009 5:28 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 22, 2009 5:34 pm    Post subject:
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    Post subject: Query on Handling User and System abends
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 29, 2009 2:51 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 29, 2009 3:02 pm    Post subject:
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: 1239
Location: Richfield, MN, USA

PostPosted: Thu Jul 30, 2009 6:48 am    Post subject:
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    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 Join in SQL Query vickey_dw DB2 2 Tue Jan 17, 2017 12:15 am
This topic is locked: you cannot edit posts or make replies. MQ setup query mohitsaini Java & MQSeries 4 Sun Jan 08, 2017 1:53 am
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm


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