Use of NEXT SENTENCE is as dangerous as GO TO.  Try using CONTINUE.

The former takes you to the next period;  the latter takes you to the end 
of the current conditional.  One missed period and ....

To replace nested IFs, try using EVALUATE - the most powerful case 
statement in any language (except structured assembler) according to a 
friend who does distributed apps.

IBM Mainframe Discussion List <[email protected]> wrote on 04/16/2012 
08:42:05 AM:

> From: "McKown, John" <[email protected]>
> To: [email protected], 
> Date: 04/16/2012 08:46 AM
> Subject: Re: GO TO "cobol"
> Sent by: IBM Mainframe Discussion List <[email protected]>
> 
> What??? "monopolizes the CPU"??? GO TO was made a pariah by an 
> article by Edgar Dijkstra.
> 
> http://en.wikipedia.org/wiki/Considered_harmful
> 
> And, of course, management went stupid (again) and came up with "you
> cannot use the GOTO in any code at all!!!!". Which actually makes 
> some COBOL more complicated due to the requirement of nesting IF 
> statements within IF statements. And before the END-IF, that could 
> be very complicated. I've see old code like:
> 
> IF ... THEN
> ...
>    IF ... THEN
>    ...
>    ELSE
>    NEXT SENTENCE
>    ...
>    IF ... THEN
>    ...
>       IF ... THEN
>       ...
>       ELSE
>       NEXT SENTENCE 
>    ELSE
>    ...
> .
> 
> Each internal IF had to have a corresponding ELSE with only NEXT 
> SENTENCE in it.
> 
> -- 
> John McKown 
> Systems Engineer IV
> IT
> 
> Administrative Services Group
> 
> HealthMarkets(r)
> 
> 9151 Boulevard 26 * N. Richland Hills * TX 76010
> (817) 255-3225 phone * 
> [email protected] * www.HealthMarkets.com
> 
> Confidentiality Notice: This e-mail message may contain confidential
> or proprietary information. If you are not the intended recipient, 
> please contact the sender by reply e-mail and destroy all copies of 
> the original message. HealthMarkets(r) is the brand name for 
> products underwritten and issued by the insurance subsidiaries of 
> HealthMarkets, Inc. -The Chesapeake Life Insurance Company(r), Mid-
> West National Life Insurance Company of TennesseeSM and The MEGA 
> Life and Health Insurance Company.SM
> 
> 
> 
> > -----Original Message-----
> > From: IBM Mainframe Discussion List 
> > [mailto:[email protected]] On Behalf Of Jake anderson
> > Sent: Sunday, April 15, 2012 10:49 PM
> > To: [email protected]
> > Subject: GO TO "cobol"
> > 
> > Hi All,
> > 
> > Apology for asking a basic question and Being Ignorant. We 
> > know that GO TO
> > statments are a big "NO" in many production sites and one of 
> > the reason
> > being it monopolizes the entire CPU. Are there any 
> > documentation explaining
> > about the  GO TO statements  which clearly describes how it 
> > effects the
> > System CPU and performances ?
> > 
> > Apology again if the question is not really sensible or else 
> > it requires
> > more information.
> > 
> > Jake
> > 
> > ----------------------------------------------------------------------
> > For IBM-MAIN subscribe / signoff / archive access instructions,
> > send email to [email protected] with the message: INFO IBM-MAIN
> > 
> > 
> 
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN


-----------------------------------------
The information contained in this communication (including any
attachments hereto) is confidential and is intended solely for the
personal and confidential use of the individual or entity to whom
it is addressed. If the reader of this message is not the intended
recipient or an agent responsible for delivering it to the intended
recipient, you are hereby notified that you have received this
communication in error and that any review, dissemination, copying,
or unauthorized use of this information, or the taking of any
action in reliance on the contents of this information is strictly
prohibited. If you have received this communication in error,
please notify us immediately by e-mail, and delete the original
message. Thank you 

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to