Remember when COBOL was originally designed. We've learned a LOT since then. 
The only real looping verb is PERFORM. It has an WHILE condition test and an 
UNTIL condition test. And, in modern COBOLs, the phrases WITH TEST BEFORE or 
WITH TEST AFTER, to perform the test at the start of the loop (0 or more 
iterations, like while in C) or at the end of the loop (1 or more iteration, 
like do while in C). WITH TEST AFTER is the default. But the UNTIL is a 
condition test and cannot execute something which returns a TRUE/FALSE type 
value.

Also remember that COBOL, at least originally, was supposed to be very 
English-like and so usable by people at the Army PFC level of training. 

-- 
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 Paul Gilmartin
> Sent: Monday, April 16, 2012 8:12 AM
> To: [email protected]
> Subject: Re: GO TO "cobol"
> 
> On Mon, 16 Apr 2012 07:28:10 -0500, McKown, John wrote:
> 
> >Our use of GO TO is generally restricted to usage such as:
> >
> >   PERFORM I-P THRU I-P-EXIT UNTIL CONDITION.
> >
> >I-P.
> >    READ FILE AT END
> >         SET CONDITION TO TRUE
> >         GO TO I-P-EXIT
> >    END-READ
> >...
> >I-P-EXIT.
> >    EXIT.
> >
> >Otherwise, to avoid the GO TO, ...
> > 
> I don't know COBOL.  However any properly designed
> language should allow incorporating such a test in the
> loop control expression:
> 
>     while read( ... ); do
>         ...
>     done
> 
> -- gil
> 
> ----------------------------------------------------------------------
> 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

Reply via email to