× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: NEXT SENTENCE & END-IF different in OPM and ILE COBOL
  • From: Howard Weatherly <hweatherly@xxxxxxxxxxxx>
  • Date: Thu, 18 Mar 1999 12:28:37 -0500
  • Organization: Computer Task Group

I guess it boils down to a matter of choice, I prefer to help the
compiler as much as possible, but you are essentially correct.

However scope delimiters and periods do not play well together.

The period marks "the end" of the, for lack of a better term, physical
statement, the scope delimiter marks the end of the logical statement,
where there could be ambiguity, the period be the man! If that is not
what the coder intended then...... well you must clense the ambiguity,
the simplest way to avoid this is to do one or the other not both, and
especially not both with respect to If - Else constructs.

There seems to be two schools of thought on the modern use of the
period, my position is that the only reason it still exists is so the
300 million lines of COBOL out there can still be compiled, I prefer to
only use a period in the following places:

SECTNAME.
 PARANAME.
    Some number of lines of code using scope delimiters
    .
 NEWPARA.
    Some more lines of code using scope delimiters
    .
ENDOFSECTION. EXIT.

If this is done this way the ambiguity disappears, the scope delimiters
make sense, and all sleep well at night (that is untill the checks dont
get printed! :)

With respect to Next Sentence, if you view the original intent of the
syntax of COBOL being english like, and you accept that the period is an
english language paradigm, then it follows that if COBOL is now more
programming language than "english prose", Next Sentence has no meaning.
The ambiguity occurs because the construct refers to where ever the
period is, ie.. the end of the sentence, where continue means just that,
continue following this logical construct e.g.

IF Condition
    Do this
    Do that
else
    Continue
End-If
>and we continue here!
stmt
stmt
stmt
.
_________________

if instead the continue were next sentence
and  the code was:
If Condition
     Do this
     Do that
else
     Next sentence
End-If
stmt
stmt
stmt
.
>Here is where next sentence is.

Do you see the problem the compiler has? what does the coder mean??
given the choice the period rules with next sentence. As far as I know,
this is not truely an OPM/ILE issue it is more an issue of usage and
intent and the way the compiler(OPM or ILE) interprets the code.

Hope this clears up at least where I am comming from.
--

Howard Weatherly

(616)961-4324

hweatherly@dlis.dla.mil
hweath@ibm.net
howard_weatherly@ctg.com
begin:vcard 
n:Weatherly;Howard
tel;pager:(800)691-7499
tel;cell:(616)260-6796
tel;fax:(616)961-7091
tel;home:(616)979-8739
tel;work:(616)961-4324
x-mozilla-html:TRUE
org:Computer Task Group / Battle Creek Federal Ctr.
adr:;;74 N. Washington;Battle Creek ;Michigan;49017;US
version:2.1
email;internet:hweatherly@dlis.dla.mil
title:Sr. Software Engineer.
x-mozilla-cpt:;-1
fn:Howard Weatherly
end:vcard

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.