Re: Infinite Loops and Explicit Exits

From: Howard Brazee (howard_at_brazee.net)
Date: 11/02/04


Date: Tue, 2 Nov 2004 21:22:25 GMT


On 2-Nov-2004, "Chuck Stevens" <charles.stevens@unisys.com> wrote:

> Well, I see your point, but I'd argue that having an inline PERFORM
> statement occurring thousands of lines before its associated UNTIL, as well
> as having an EXIT PERFORM and/or an EXIT PERFORM CYCLE buried somewhere in
> the middle of those thousands of lines based on conditions that might have
> nothing whatever to do with the UNTIL, is perfectly legitimate TODAY. What
> isn't legitimate is turning those thousands of lines into a paragraph so
> that the UNTIL is closer to the PERFORM, and having *that* work, because the
> EXIT PERFORM and the EXIT PERFORM CYCLE wouldn't be legal.

Good point.

It would be useful to have a good way to exit the following PERFORM loop.

     PERFORM UNTIL FILE-EOF
        ....
        PERFORM PROCESS-RECORD
** The above paragraph grew too big, so I stuck it later in the program.
        ...
     END-PERFORM.
PROCESS-RECORD.
     ...
     IF WEIRD-CONDITION
        Get the Hell out of Dodge
     END-IF
     ...



Relevant Pages

  • Help! GO TO and PERFORM THRU!
    ... For some reason, the use of SECTIONS is more common in Europe ... to exit from within an inline loop. ... EXIT PARAGRAPH and EXIT SECTION provide ...
    (comp.lang.cobol)
  • Re: Infinite Loops and Explicit Exits
    ... > COBOL program is that the program branched out of a perform range and ... paragraph and return to the next statement after the PERFORM command - ... paragraph as an exit from the performed paragraph. ... A way to exit a performed paragraph loop and go to the next statement (as though ...
    (comp.lang.cobol)
  • Re: Infinite Loops and Explicit Exits
    ... > CS> One of these proposals relaxes the current restriction that an EXIT ... > termination of the loop is not visible at that point. ... > terminating condition is visible in that context. ... > You now want to allow this remote procedure, ...
    (comp.lang.cobol)
  • Re: Para1 THRU Para2
    ... HB>>> The best way to exit a paragraph this way is with an EXIT ... r> putting everything in one sentence makes the nesting too deep. ... One has to look at this logically, and create a transformation ...
    (comp.lang.cobol)
  • Re: COBOL aint quite dead - yet !
    ... sometimes I will replace the EXIT. ... the exactly the same label made into a comment. ... Putting in a paragraph label is a lightweight ... possibility of errors such as goto the wrong one, ...
    (comp.lang.cobol)