Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

COBOL and exceptions (was: Passing an invalid date to INTEGER-OF-DATE
There was a lot of discussion as to whether or not the '89 Amendment should 
have
been passed with no method for detecting argument errors.  The first draft D
ID
include returned-values to indicate "problems" - but as some functions could
have invalid arguments but NO returned value was always "invalid" this was
(eventually) rejected.

The '02 Standard (as Chuck indicates) did introduce a "Common Exception
Handling" facility that was intended to provide a "common" solution to ALL o
f
the exceptions mechanisms previously available - as well as for some things
(like "incompatible data" and invalid arguments) for which NO mechanism
previously existed.

The most controversial part of this proposal (now standard) was whether
detection should be "inline" (IF right after the exception) or out-of-line
(declaratives).  The Standard went with the latter *and* provided a "RESUME"
statement that let you restart at a few "selectable" places.  This requires
"totally UN-structured" code and is still (at least a little) controversial.

HOWEVER, and this is a BAGGIE !!!!
I know of NO vendor who has actually implemented the '02 Standard "common
exception handling" specification (much less implemented it completely).  I 
have
heard (unofficially) from some vendors that they have ZERO intention of ever
doing so - even if they did everything else in the '02 Standard.  At least o
ne
vendor has adopted a C-like "throw/catch" (or whatever C uses) facility.

The good news (related to the initial thread) is that the '02 Standard also
introduced some TEST-xxxx intrinsic functions that allow a programmer to
"validate" arguments for a number of other intrinsic functions and to determ
ine
why they are invalid (if they are).  I don't know which vendors (if any) hav
e
implemented these, but I have heard more positive feedback about them - than
 for
the entire "common exception handling" model.

P.S.  For those used to other environments, the Common Exception Handling
facility is similar (not identical to) the PL/I "ON-unit" facility and/or th
e
(IBM CICS) EXEC CICS HANDLE CONDITION facility.

--
Bill Klein
wmklein <at> ix.netcom.com
"Chuck Stevens" <charles.stevens@unisys.com> wrote in message
news:d700q2$b7s$1@si05.rsvl.unisys.com...
> I'm not convinced ON ERROR is necessarily the best approach here, or for
> that matter in general, particularly given the ability to "nest" function
> calls.
>
> The '02 standard includes exception handling (for this and in general) in 
a
> way that, in my opinion, doesn't invalidate existing programs and allows
> their enhancement to catch such problems.  Lobby your vendors!
>
>    -Chuck Stevens
>
> "Howard Brazee" <howard@brazee.net> wrote in message
> news:d6vutt$3fp$1@peabody.colorado.edu... 
> 20050532 
> designed for 
> doesn't 
> design - as 
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
William M. Klein
05-25-05 01:55 AM


Re: COBOL and exceptions (was: Passing an invalid date to INTEGER-OF-DATE
"William M. Klein" <wmklein@nospam.netcom.com> wrote in message
news:mWLke.169630$hh4.32263@fe06.news.easynews.com...

> The good news (related to the initial thread) is that the '02 Standard
also
> introduced some TEST-xxxx intrinsic functions that allow a programmer to
> "validate" arguments for a number of other intrinsic functions and to
determine
> why they are invalid (if they are).

... and that includes function TEST-DATE-YYYYMMDD, which returns 1 if the
year is out of range, 2 if the month is out of range, 3 if the day of the
month is out of range for the given month and year, and 0 if the date is a
valid YYYYMMDD date.   Julian dates are also covered (function
TEST-DAY-YYYYDDD).


-Chuck Stevens



Report this thread to moderator Post Follow-up to this message
Old Post
Chuck Stevens
05-25-05 01:55 AM


Re: COBOL and exceptions (was: Passing an invalid date to INTEGER-OF-DATE
"William M. Klein" <wmklein@nospam.netcom.com> wrote in message
news:mWLke.169630$hh4.32263@fe06.news.easynews.com...

> The good news (related to the initial thread) is that the '02 Standard
also
> introduced some TEST-xxxx intrinsic functions that allow a programmer to
> "validate" arguments for a number of other intrinsic functions and to
determine
> why they are invalid (if they are).

... and that includes function TEST-DATE-YYYYMMDD, which returns 1 if the
year is out of range, 2 if the month is out of range, 3 if the day of the
month is out of range for the given month and year, and 0 if the date is a
valid YYYYMMDD date.   Julian dates are also covered (function
TEST-DAY-YYYYDDD).


-Chuck Stevens



Report this thread to moderator Post Follow-up to this message
Old Post
Chuck Stevens
05-27-05 08:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 10:24 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.