Re: Infinite Loops and Explicit Exits

From: Chuck Stevens (charles.stevens_at_unisys.com)
Date: 11/02/04


Date: Tue, 2 Nov 2004 12:48:24 -0800


"Lueko Willms" <l.willms@jpberlin.de> wrote in message
news:9K6g0sweflB@jpberlin-l.willms.jpberlin.de...
> . On 01.11.04
> wrote charles.stevens@unisys.com (Chuck Stevens)
> on /COMP/LANG/COBOL
> in cm63go$1780$1@si05.rsvl.unisys.com
> about Re: Infinite Loops and Explicit Exits
>
>
> CS> Those who suggest that GO TO, PERFORM THRU, and the use of SECTIONs
> CS> in COBOL should be archaized in, marked obsolete in, or eliminated
> CS> from the standard -- and these are the three steps in that process --
> CS> are.
>
> GOTO, PERFORM THRU yes, but SECTIONS no. The opposite makes sense.
> The first step to clean up the code is to put a SECTION header on top
> of that paragraph-thru-paragraph sentence and eliminate all the
> paragraph labels inbetween, restructuring that section into proper
> decision and repetition instructions.
>
> So one can by and by change such a program into something readable
> and maintainable.

Yes, you can. But do you wanna take on restructuring a 500,000-line
monolithic COBOL program to make that happen?

There are cases in which EXIT PERFORM is, I think, clearer than GO TO
<some-arbitrary-paragraph-somewhere>. Also, while I would argue that a
paragraph that might be the beginning of a PERFORM range, the end of a
PERFORM range, or somewhere in the middle of a PERFORM range in a given
program would be evidence of *questionable* style, the standard doesn't
prohibit it, and I would argue shouldn't prohibit it. I think EXIT PERFORM
adds readability, and it might not even be *possible* to determine "locally"
what the appropriate terminus of the PERFORM range is. Moreover,
*elegance* of coding style should not be dictated by the COBOL standard,
particularly when the requirements of elegance invalidate existing programs.
Matters of elegance are best left to the educators.

    -Chuck Stevens



Relevant Pages

  • Re: If you were inventing CoBOL...
    ... I can't get COBOL to produce a *floating* version of the most common ... EXIT PARAGRAPH and EXIT SECTION provide good support for structure ... disallowed in other contexts in the '02 standard. ... EXIT PARAGRAPH and EXIT SECTION are big helps here. ...
    (comp.lang.cobol)
  • Re: Infinite Loops and Explicit Exits
    ... Infinite Loops and Explicit Exits ... > CS> EXIT PERFORM and EXIT PERFORM CYCLE in 2002 COBOL, ... Did you write a formal proposal to that effect, either to your COBOL ... > CS> rewrite is extensive. ...
    (comp.lang.cobol)
  • Re: Report enhancements
    ... CS> needs to be added to 20xx COBOL because it's not in 1985 COBOL, ... CS> might be a good idea to see if that capability exists in the ... means of the EXIT statement -- so why has this duplication been added? ... loop on the one hand and to specify that there is no test at all. ...
    (comp.lang.cobol)
  • Re: brain teaser
    ... but Cobol standard does and that makes your code less portable. ... I'll use EXIT PARAGRAPH as soon as its available for my compiler. ... I do program with languages such as C# and Ruby (Ruby doesn't even ...
    (comp.lang.cobol)
  • Re: Is it always possible to write a COBOL program using only 1 sentence per paragraph?
    ... > available with your compiler. ... > to an EXIT PERFORM would do the conversion correctly. ... END-IF ... I'm supposed to accept COBOL ...
    (comp.lang.cobol)