Yes, modern COBOL is much better. I don't use COBOL much, and other than the
new END-verb constructs, don't do much. But you still need a PERFORM to loop.
I.e. you cannot loop in the READ verb itself. Might be nice.
I guess you could:
PERFORM UNTIL EOF
READ ...
AT END
SET EOF TO TRUE
NOT AT END
...
END-READ
END-PERFORM
I haven't looked recently, but we have a lot of old code. So we don't have much
with the newer constructs.
--
John McKown
Systems Engineer IV
IT
Administrative Services Group
HealthMarkets®
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® is the brand name for products underwritten and issued by the
insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance
Company®, 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 Bill Ashton
> Sent: Monday, April 16, 2012 8:36 AM
> To: [email protected]
> Subject: Re: GO TO "cobol"
>
> John, the READ construct now is much easier with
>
> READ FILE
> ....AT END
> ........Do stuff
> ....NOT AT END
> ........Do normal processing
> END-READ
>
> This makes it really easy to keep the code tight and all
> together. By using
> program switches, I have handled program start and end, abend, and
> processed 6 or 7 files with no (or very few) paragraphs, and
> only a couple
> statements ending with periods. It actually was fun to put
> together and
> was easy to maintain. However, it would not always be this
> streamlined for
> some large programs with lots of things going on.
>
> Billy
>
> On Mon, Apr 16, 2012 at 8:28 AM, McKown, John
> <[email protected]
> > 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, we'd need to do:
> >
> > I-P.
> > READ FILE AT END
> > SET CONDITION TO TRUE
> > END-READ
> > IF NOT CONDITION THEN
> > ...
> > END-IF.
> > I-P-EXIT.
> > EXIT.
> >
> > Which I consider to be worse than the exit, so far as
> comprehension is
> > concerned.
> >
> > --
> > John McKown
> > Systems Engineer IV
> > IT
> >
> > Administrative Services Group
> >
> > HealthMarkets®
> >
> > 9151 Boulevard 26 . N. Richland Hills . TX 76010
> > (817) 255-3225 phone .
> > [email protected] .
> www.HealthMarkets.com<http://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® is the brand name for products
> underwritten and
> > issued by the insurance subsidiaries of HealthMarkets, Inc.
> -The Chesapeake
> > Life Insurance Company®, 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 Thomas Berg
> > > Sent: Monday, April 16, 2012 5:40 AM
> > > To: [email protected]
> > > Subject: SV: GO TO "cobol"
> > >
> > > An alternative is to have e g an 88-type LEAVE item that is
> > > checked for every code-block including all iterations and
> selections.
> > > (You set leave to true when wanting to do a "leave" type jump.)
> > >
> > >
> > >
> > > Regards,
> > > Thomas Berg
> > > ______________________________________________________
> > > Thomas Berg Specialist AM/DQS SWEDBANK AB (publ)
> > >
> > >
> > >
> > > > -----Ursprungligt meddelande-----
> > > > Från: IBM Mainframe Discussion List
> > > [mailto:[email protected]] För
> > > > Edward Jaffe
> > > > Skickat: den 16 april 2012 08:15
> > > > Till: [email protected]
> > > > Ämne: Re: GO TO "cobol"
> > > >
> > > > On 4/15/2012 10:31 PM, Wayne Bickerdike wrote:
> > > > > For devotees of Jackson Structured programming, the GOTO
> > > is a must for
> > > > > POSIT and ADMIT processing. Otherwise it can be messy
> > > avoiding a GOTO.
> > > >
> > > > The problem with GOTO is that the suitability of the
> target branch
> > > > location is
> > > > not enforced by the compiler according to any
> structured discipline.
> > > >
> > > > Premature terminations (posit/quit/admit) can almost always
> > > be handled
> > > > with
> > > > LEAVE-type statements or immediate return from a
> subroutine. Some
> > > > languages have
> > > > SIGNAL, EXIT, etc. which can help provide structured premature
> > > > termination for
> > > > larger routines without resorting to the dreaded GOTO.
> > > >
> > > > --
> > > > Edward E Jaffe
> > > > Phoenix Software International, Inc
> > > > 831 Parkview Drive North
> > > > El Segundo, CA 90245
> > > > 310-338-0400 x318
> > > > [email protected]
> > > > http://www.phoenixsoftware.com/
> > > >
> > > >
> > >
> ----------------------------------------------------------------------
> > > > 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
> > >
> > >
> >
> >
> ----------------------------------------------------------------------
> > For IBM-MAIN subscribe / signoff / archive access instructions,
> > send email to [email protected] with the message: INFO IBM-MAIN
> >
>
>
>
> --
> Thank you and best regards,
> *Billy Ashton*
>
> ----------------------------------------------------------------------
> 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