• Subject: NEXT SENTENCE & END-IF different in OPM and ILE COBOL
  • From: Vanya Jovic <jovic@xxxxxxxxxxxx>
  • Date: Fri, 12 Mar 1999 18:33:24 -0700 (MST)
  • Organization: Calgary Community Network Assoc.

Hi ppl,

any ideas why NEXT SENTENCE in IF ... ELSE... END-IF statement behaves
differently in OPM and ILE COBOL?

Both manuals describe same behaviour, and it seems than OPM manual is


IF <something true>
        <some statement>
<statement A>
<statement B>.   (pay attention to period)
<statement C>

In OPM, on true condition, after NEXT SENTENCE, <statement A> is executed!
In ILE, on true condition, after NEXT SENTENCE, <statement C> is executed!

This was tested with both debbugers (STRISDB for OPM and STRDBG for OPM
and ILE), on V3R7 and V4R3.

According to both manuals, ILE behaviour is correct (... program control
is given to the statement after first period ...).

Any ideas?

        I know, I know, this is wery bad programming tactics, and I
personally cosider NEXT SENTENCE completely redundant, but one can't
choose which legacy programs to maintain. Besides, ILE editor would even
warn if you try to use NEXT SENTENCE and END-IF, but compiler would let
compile with message severity 20. If you don't touch the code, but only
recompile in ILE, without checking the compiler listing, ... you may get
in the big trouble.

Vanja Jovic

| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com

This thread ...


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

This mailing list archive is Copyright 1997-2019 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].