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
 

 

How to Trap the abends in JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
iknow

Active User


Joined: 22 Aug 2005
Posts: 413
Location: Colarado, US

PostPosted: Sat Nov 19, 2005 2:49 pm    Post subject: How to Trap the abends in JCL
Reply with quote

Hi All,

How can I trap abends in JCL? Give the exact JCL please.
Back to top
View user's profile Send private message

MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Sat Nov 19, 2005 9:37 pm    Post subject:
Reply with quote

I suppose that you must use a program that get each return code of all step and run with a cond=even.
If you search in this forum you will find some question already threated.

I hope in this help
Back to top
View user's profile Send private message
iknow

Active User


Joined: 22 Aug 2005
Posts: 413
Location: Colarado, US

PostPosted: Tue Nov 22, 2005 9:55 am    Post subject: Re: How to Trap the abends in JCL
Reply with quote

Hi MGIndaco,

Thanks for your reply... I will search for the information in the forum.

If I still find some problems with the issue I will get back to you.
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Tue Nov 22, 2005 10:09 am    Post subject: Trap Abends in JCL
Reply with quote

hi frnd,
I think LASTCC in the steps will help to trap the abend codes in the JCL. Try it out. Let me know.
Back to top
View user's profile Send private message
iknow

Active User


Joined: 22 Aug 2005
Posts: 413
Location: Colarado, US

PostPosted: Mon Dec 12, 2005 8:51 am    Post subject: Re: How to Trap the abends in JCL
Reply with quote

Hi All,

As a follow up to the previous posts, I am just adding some more information on how to trap abends in JCL.

The solution is
Use IF ABEND statement in the JCL.

Can anyone tell me how to use IF ABEND statement in JCL.


Correct me if I am wrong.
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Mon Dec 12, 2005 10:37 am    Post subject: IF Statement
Reply with quote

Hi frnd,

Try this

Code:
//IFBAD IF (ABEND OR STEP1.RC GT 8) THEN
//TRUE EXEC PROC=ERROR
//IFBADEND ENDIF
//NEXTSTEP EXEC PROC=CONTINUE


i think the above code helps u....
Back to top
View user's profile Send private message
iknow

Active User


Joined: 22 Aug 2005
Posts: 413
Location: Colarado, US

PostPosted: Mon Dec 12, 2005 11:10 am    Post subject: Re: How to Trap the abends in JCL
Reply with quote

Hi khamurutheen,

Thanks for your information.
Back to top
View user's profile Send private message
iknow

Active User


Joined: 22 Aug 2005
Posts: 413
Location: Colarado, US

PostPosted: Sat Dec 17, 2005 2:38 pm    Post subject: Re: How to Trap the abends in JCL
Reply with quote

Hi All,

Some more information on how to trap abends+errors in JCl.

There are many types of JCL errors. Some are due to invalid syntax and are flagged by JES at job submission time prior to execution. Others, such as lack of DASD space or out of space conditions, happen prior to or during step execution and are also called JCL errors.

I think what you want to do at a minimum is look at the COND parameter of the EXEC JCL statement. But I highly recommend using conditional JCL processing statements (IF/THEN/ELSE/ENDIF) instead. They are much easier to understand and are more flexible than using COND. Even though the conditional JCL statements have been around since before OS/390 (since MVS/ESA V4), I find most people still don't use them, especially in their "legacy" production JCL.

Here are some conditional JCL examples related to abends (condition codes can also be checked just like on the COND statement):

Code:
//STEP1      EXEC PGM=MYPROG1
  //           IF    (ABEND=TRUE)   THEN
  //ERROR1     EXEC  PGM=CLEANUP
  //           ENDIF
  //NEXTSTEP   EXEC  PGM=MYPROG2



     //STEP2      EXEC PGM=MYPROG1
     //           IF    (ABENDCC=S0C7)   THEN
     //ERROR2     EXEC  PGM=BADDATA
     //           ENDIF
     //NEXTSTEP   EXEC  PGM=MYPROG2


For more information please see the following JCL manuals:
    MVS JCL Reference
    MVS JCL User's Guide
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 IEFZB476 getting various 0C4 abends Grant Goodale PL/I & Assembler 18 Sat Sep 12, 2015 9:27 pm
No new posts EMPTY FILE - JOB ABENDS d_sarlie JCL & VSAM 4 Fri Jul 25, 2014 1:42 am
No new posts all my abends seemed so far away. Pedro General Talk & Fun Stuff 11 Thu May 01, 2014 12:14 am
No new posts DEFINE PAGESPACE Abends - why? prino JCL & VSAM 3 Tue Apr 24, 2012 10:14 pm
No new posts AEIL/ ASRA abends in CICS Puja Baranwal CICS 3 Mon Feb 27, 2012 5:41 pm


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