Re: newbie question on cobol syntax



On Sun, 22 Apr 2007 23:52:11 GMT, "William M. Klein"
<wmklein@xxxxxxxxxxxxxxxxx> wrote:

There is a SEMANTIC difference for periods. They end SENTENCES. This is where
a NEXT SENTENCE phrase (or statement - if your compiler has such a statement as
an extension - as Micro Focus does) will "go to". For example.

If Field-1 = A
Next Sentence
Else
Display "Here"
.
Display "There"
.

Gets very different results from

If Field-1 = A
Next Sentence
Else
Display "Here"
Display "There"
.

Some compilers will allow

If Field-1 = A
Next Sentence
Else
Display "Here"
End-IF

Display "There".

In which case "Next Sentence" still goes to the next sentence. I
see no advantage in ever using NEXT SENTENCE now that CONTINUE is
available.

Some pre-compilers create implicit IF statements without creating
END-IF statements. In these special cases, a style of including
full-stop periods can be beneficial. But in other cases, the
Righteous arguments for one style over another are more of a religious
nature.

And it is easy to see what Righteous people inflict on the world.
.



Relevant Pages

  • Re: debugging
    ... OS & compiler. ... 77 CONS PIC 9V99; COMP 3. ... DISPLAY "CONSOMMATION ?". ... 0065:Improper punctuation. ...
    (comp.lang.cobol)
  • Re: Logic Bug
    ... "How are SUBW and MAX-WIRES defined?" ... It looks like the compiler is taking the IF following the PERFORM as ... you might want to put a DISPLAY ... > MAX-WIRES which until someone changes the program will remain at 50. ...
    (comp.lang.cobol)
  • Re: DISPLAY
    ... I am afraid I don't know much about the compiler I am ... >If you are using screen description entries with a Format 2 DISPLAY ... >manuals, then you can probably get them online from the supplier, many ... >are free downloads. ...
    (comp.lang.cobol)
  • Re: DISPLAY
    ... I am afraid I don't know much about the compiler I am ... >If you are using screen description entries with a Format 2 DISPLAY ... >manuals, then you can probably get them online from the supplier, many ... >are free downloads. ...
    (comp.lang.cobol)
  • Re: DISPLAY
    ... I am afraid I don't know much about the compiler I am ... >If you are using screen description entries with a Format 2 DISPLAY ... >manuals, then you can probably get them online from the supplier, many ... >are free downloads. ...
    (comp.lang.cobol)