Prev: COBOL "non-myth" confirmed - Index and subscripts (MF on Windows)
Next: System Conversion - An Overview
From: Frank Swarbrick on 24 Sep 2007 11:53 >>> On 9/21/2007 at 10:48 PM, in message <L81Ji.49884$TK1.22637(a)fe04.news.easynews.com>, William M. Klein<wmklein(a)nospam.netcom.com> wrote: > "Frank Swarbrick" <Frank.Swarbrick(a)efirstbank.com> wrote in message > news:46F4154F.6F0F.0085.0(a)efirstbank.com... >>>>> On 9/21/2007 at 5:01 PM, in message > <snip> >> From reading the COBOL 2002 standard and later revisions many, many > times I >> am still unable to 'grok' the use of 'common exception handling' in > COBOL. >> For instance, there appears to be nothing similar to the > "try/catch/finally" >> pattern in many other languages. >> >> I would be interested to see an actual example of how common exception >> handling is intended to work in COBOL. >> > > One of the "issues" with the '02 Common Exception Handling "model" was > the > decision to use DECLARATIVES - as these were already a "part of the > language" > for a few exceptions. there is LIMITED control on such things in the > '02 > Standard by using the > >>TURN > compiler directing statement to "localize" where detecting exceptions > occurs. > The RESUME statement (which will probably be made optional in the next > revision - if any) has some options for how/where execution resumes (if > the > program decides to do so). > > I don't know if this helps any - and I certainly think that the basic > "desing" > is part of the reason that no compiler vendor has fully implemented it > (and few > have implemented it at all). If you care, I believe the model is MOST > similar > to that which has (alwasy?) been available with PL/I (or even the EXEC > CICS > HANDLE CONDITON). The two designs are NOT identical, but they are more > similar > to each other than to newer Try/Catch/Finally type designs. I'm all for the more generic use of DECLARATIVES as use for a 'catch all' for exceptions, but it seems like localization would be useful as well. Ah well. Not like any of this will ever be implemented where it would be useful to me anyway... Frank |