View previous topic :: View next topic |
Author |
Message |
madhu_jul Beginner
Joined: 28 Nov 2006 Posts: 6 Topics: 2
|
Posted: Thu Feb 15, 2007 2:39 am Post subject: Is exception handling or abend handling possible in JCL? |
|
|
Hi,
If STEP1 is abending with U0241, is it possible for the STEP2 to make the job complete with MAXCC=0?
Currently, i am using
STEP1
IF ABENDCC=U0241 THEN
STEP2
ENDIF
The STEP2 is executing fine but the job is still abending. Is it possible to avoid this abend? if yes then how?
Thanks,
Madhu |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Thu Feb 15, 2007 7:08 am Post subject: |
|
|
madhu_jul,
U0241 is a user abend code and it is not a condition code you can check. If you want the step to always run in case of an abend then code ONLY on the next step. This step will run if previous step has abnormally terminated.
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
madhu_jul Beginner
Joined: 28 Nov 2006 Posts: 6 Topics: 2
|
Posted: Thu Feb 15, 2007 10:46 pm Post subject: |
|
|
Hi Kolusu,
STEP2 is executing when STEP1 is abending with U0241.
In STEP2 we are actually sending a mail, which executes successfully when the STEP1 is abending witht U0241.
But our aim is to avoid the ABEND, ie when STEP1 abends the mail should be sent in STEP2 and the job should complete with MAXCC=0 and not abend.
But currently the job is abending with U0241. Is there any way by which i can make the job not to abend?
Thanks,
Madhu |
|
Back to top |
|
 |
programmer1 Beginner
Joined: 18 Feb 2004 Posts: 138 Topics: 14
|
Posted: Thu Feb 15, 2007 11:37 pm Post subject: |
|
|
I didn't understand this.
Your topic says "Exception Handling" but what you are looking for is "How may I close my eyes to any abend".
Why are we not concentrating on resolving the abend ?
If I am not wrong, it's not that easy to fool ourselves by changing the job return code to 0 when it was not. _________________ Regards,
Programmer |
|
Back to top |
|
 |
madhu_jul Beginner
Joined: 28 Nov 2006 Posts: 6 Topics: 2
|
Posted: Fri Feb 16, 2007 12:09 am Post subject: |
|
|
The USER abend in already generated in a program which we cannot alter. Now we want to avoid one particular abend alone. Other than the ABENDCC check we have many other conditions checks in STEP2.
Everything is working fine. Except that the job is still abending. i want to know if avoiding it is possible or not? And if anybody has worked on somehting like this successfully?
Thanks,
Madhu |
|
Back to top |
|
 |
prasanth_thavva Beginner

Joined: 14 May 2006 Posts: 40 Topics: 18
|
Posted: Fri Feb 16, 2007 3:06 am Post subject: |
|
|
Hi,
REGISTER is availbe in COBOL.,is it possible to handle a user abend if we can use REGISTER to suppress the condition code.
Otherwise u can use EVEN in cond pmt.
EVEN wll allow u to execute the step even any abend occured in previous step and viceversa
Thanks&Regards
Venkata Prasanth Thavva  _________________ Thanks&Regards
Prasanth Thavva |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Fri Feb 16, 2007 4:39 am Post subject: |
|
|
I think that once your abend code is issued (STEP1 ended) you cannot revert it. You would have to trap it before STEP! ends - but then STEP" will not know that it has to run. But, perhaps if you executed the problem program under batch TSO you could trap the abend and set a RC of, say, 4 and get STEP2 to excuted based on that RC. But, the ideal solution is GET THE THING FIXED _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Fri Feb 16, 2007 7:25 am Post subject: |
|
|
You canNOT change the maxCC code unless you sweep thru control blocks and reset it.
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
madhu_jul Beginner
Joined: 28 Nov 2006 Posts: 6 Topics: 2
|
Posted: Tue Feb 20, 2007 4:57 am Post subject: |
|
|
Kolusu, how to sweep thru control blocks and reset it?
Nic Clouston, As i had mentioend already, STEP1 executes a program which i cannot alter. So now is there a way i can trap the abend in STEP1 itself? |
|
Back to top |
|
 |
Cogito-Ergo-Sum Advanced
Joined: 15 Dec 2002 Posts: 637 Topics: 43 Location: Bengaluru, INDIA
|
Posted: Sun Feb 25, 2007 9:13 pm Post subject: |
|
|
Madhu,
What Kolusu refers to is an extreme step. And, what you are completely missing out is, programmer1's valid point : Quote: | If I am not wrong, it's not that easy to fool ourselves by changing the job return code to 0 when it was not. |
You might want to consider splitting your job into two. First one ends at the step that is throwing the Uxxx abend. And, the second one having the email step that is triggerred under certain conditions. Get your Operations people's assistance to better advise you. _________________ ALL opinions are welcome.
Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes. |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Tue Feb 27, 2007 5:37 am Post subject: |
|
|
I did not say to change the program. To try and make it clear I said execute TSO batch in Step 1. This would execute a Rexx exec. The Rexx exec would execute your program - as is. Once your program finished the Rexx exec would query the return code. The Rexx exec would then end with whatever return code you wanted. But the ideal solution is to stop the program abending. If you cannot change it then get whoever is authorised to change it. Or change whatever needs to be changed to stop it abending - pre-editing data etc. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
madhu_jul Beginner
Joined: 28 Nov 2006 Posts: 6 Topics: 2
|
Posted: Sat Mar 10, 2007 6:54 am Post subject: |
|
|
Thanks everyone for you valuable inputs. We finally proved to our higher ups that this is not possible and that we need to edit the abending program.
I wouldnt have had the confidence to argue that it is not possible to change the abend to RC values if not for you inputs. Thanks a lot. |
|
Back to top |
|
 |
shreekanth.M Beginner
Joined: 11 Mar 2007 Posts: 6 Topics: 2 Location: Hyd
|
Posted: Mon Mar 12, 2007 5:54 am Post subject: |
|
|
If i understand correct, you would like to send a mail to support person if there is a abend in First step.
There must be some return code from 1st Step, u can use the below statement to Reset Return code 00.
STEP 1
IF LASTCC < 5 THEN
SET MAXCC = 0
I hope this works _________________ Kanth |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Mon Mar 12, 2007 6:53 am Post subject: |
|
|
shreekanth.M wrote: | If i understand correct, you would like to send a mail to support person if there is a abend in First step.
There must be some return code from 1st Step, u can use the below statement to Reset Return code 00.
STEP 1
IF LASTCC < 5 THEN
SET MAXCC = 0
I hope this works |
Shreekanth.M,
Please read this. You canNOT reset the job return code
http://mvsforums.com/helpboards/viewtopic.php?p=5283#5283 _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
shreekanth.M Beginner
Joined: 11 Mar 2007 Posts: 6 Topics: 2 Location: Hyd
|
Posted: Mon Mar 12, 2007 10:08 am Post subject: |
|
|
Hi Kolusu,
Please correct me if i my understanding is wrong.
//STEP1 EXEC PGM=IDCAMS
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSDBOUT DD SYSOUT=*
//SYSIN DD DSN=&VHLQ..PARMLIB(MMXXBDL),
// DISP=OLD
// DD DSN=&VHLQ..PARMLIB(MAXCC12),
// DISP=SHR
// DD DSN=&VHLQ..PARMLIB(MMXXDE),
// DISP=SHR
In above step the first parm is to del MMXX file. The second parm is to set Maxx 0 if there is any RC less then 12 while deleting and third one to define new file.
If we dont use MAXCC12 parm to reset 0, the file will be defined but the job will abend with some Retrun code less then 12, Even if there are steps below Step1 completeing with 0 RC. But if we use the MAXCC12 parm the final RC of job will be also 0.
MAXCC12 parm is as below
IF MAXCC <= 12 THEN SET MAXCC=0
Is it that MAXCC can be set to 0 only for utilities program like IDCAMs, ADRDSSU. _________________ Kanth |
|
Back to top |
|
 |
|
|