Re: EXIT PARAGRAPH on z/OS was Re: Bad habits of GOTO-using programmers



On Wed, 12 Nov 2008 16:59:42 -0400, Clark F Morris <cfmpublic@xxxxxxxxxxxxxxx> wrote:

On Tue, 11 Nov 2008 22:56:42 -0500, Robert <no@xxxxxx> wrote:

On Tue, 11 Nov 2008 12:50:24 -0700, Howard Brazee <howard@xxxxxxxxxx> wrote:

On Tue, 11 Nov 2008 09:20:19 -0800 (PST), Richard
<riplin@xxxxxxxxxxxx> wrote:

I'd be satisfied with an up-to-date compiler allowing me to
EXIT-PERFORM.    

EXIT PERFORM is only allowed within in-line PERFORMs. It won't jump
out of a PERFORMed paragraph.

So those who are in favor of exit paragraphs still have a valid
argument. In maintenance we don't want to redesign the flow, and
switches are, IMHO worse than GO TO EXIT.

Well written code doesn't need switches nor go to. If you think you need a switch, there's
something wrong with your structure.

All languages need ways of exiting loops. CoBOL programs need to be
able to exit performed paragraphs. Right now, the options are clumsy
and subject to error. Simplicity is the key here.

EXIT PARAGRAPH is simple. Falling to the end is even simpler.

I doubt COBOL for z/OS has yet been upgraded to have anything that
modern or useful.

The reason is lack of demand. It would be of no use to customers who write
PERFORM A1200-RD-SBMSTR THRU A1200-RD-SBMSTR-EXIT.
.



Relevant Pages

  • 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)
  • Re: COBOL aint quite dead - yet !
    ... sometimes I will replace the EXIT. ... was via the last paragraph. ... In Cobol a label may be the target of a goto, a perform, a drop ...
    (comp.lang.cobol)
  • Re: Infinite Loops and Explicit Exits
    ... Massive changes qualify as a 'redesign'. ... A perform of a section or a perform of a paragraph is no matter as both ... Afterwards they would reset the exit point back to what it ... > was a NULop. ...
    (comp.lang.cobol)
  • Re: Is it possible to use the value of the PROGRAM ID within the source code?
    ... The IBM 705 had an instruction pair something ... And once you were used to using such now known as bad practice ... Then what was EXIT intended for? ... >>a paragraph, how is one to reach an EXIT statement save through PERFORM ... ...
    (comp.lang.cobol)