P. 1
Error Handling

Error Handling

|Views: 1|Likes:
Published by Shubham Khare

More info:

Published by: Shubham Khare on May 09, 2012
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as DOCX, PDF, TXT or read online from Scribd
See more
See less





Error Handling


   

1 Introduction 2 Just Abend 3 Fail-Fast 4 The Decision Process

Pragmatically, there are two approaches to error handling in a CICS application: fail-fast and just abend.

Just Abend
The latter approach is relatively simple, as it is the default for most exceptions that may occur in a CICS API - don't code the NOHANDLE, RESP and RESP2 options. When most exceptional conditions occur in a CICS API, your program will abend. You will be the recipient of a core dump of the machine state at the point of error. An application programmer can also do something similar with respect to (e.g.) an unexpected SQLCODE. Check the appropriate return code and EXEC CICS ABEND if it is not of the expected value. This has its good and bad points. Coding in this manner ensures the machine state hasn't been altered by the execution of any application code. However, you must debug by reading the core dump, a technique currently out of favor in many IT shops. Additionally, care must be taken to not produce a large number of dumps due to an error which prevents processing from continuing. For example, if DB2 is currently unavailable, all applications written in this manner will begin dumping core and only serve to exacerbate the problem by potentially bringing down the CICS region.

The fail-fast approach is to detect and report the error. While one may argue that abending is a mechanism by which an error is reported, the idea here is to report the error in a manner more conducive to quick error resolution. One available avenue for reporting errors is the WRITE OPERATOR API. This allows reporting of the error in a manner friendly to automation software which can be used to (e.g.) page support staff. Having

Either of these error reporting avenues are assisted by shared subroutines which encapsulate the necessary code. Craig Schneiderwent 14:03. Subsequent to reporting the error. shop standards. perhaps redirected to a spool DD. The downside of the fail-fast approach is that at this point the machine state has been altered from what it was at the time of the error by the error reporting code. The Decision Process At the end of the day. an application may choose to produce a core dump. the decision as to which approach is used must take into consideration the cost to the business of each type of failure. as the error message can be viewed in context with other messages. Another avenue of reporting is a special purpose TD queue. with or without abending. Example code implementing the fail-fast approach can be found in file 788 on the CBTTAPE web site. and any applicable Service Level Agreements. Care must be also taken when using this approach to not produce a large number of messages due to an error which prevents processing from continuing. 5 October 2008 (CDT) Category: Programming     article discussion view source history  navigation Log in / create account      Main Page Help Need an id? Community Forum .the error recorded in the system log can have other benefits. Overwhelming the spool merely exacerbates the problem. the skill set of those responsible for error resolution. the cost of an outage.

                   CICS Jobs CICS in the news CICS alerts Online users News feed create content Create page Boot Camp How do I.. 5 October 2008.  This page has been accessed 761 times.. . discover pages Categories Popular pages Recent pages Site statistics Wanted pages Random page Adoption plan resources IBM CICS site CICS Infocenter The Master Terminal Trivia search Go Search toolbox       What links here Related changes Upload file Special pages Printable version Permanent link  This page was last modified 19:03.

 Privacy policy  About CICS Wiki  Disclaimers .

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->