Re: newbie question on cobol syntax



Top post:

The really significant context of where a full stop/period is placed is when it terminates an 'if' clause, by being present:

if a = b
move xyz to mars.
move threesome to somewhere
(in this example, threesome gets moved to somewhere unconditionally; the period/full stop terminates the list of actions governed by the 'if'.)

-- compared with ---

if a = b
move xyz to mars
move threesome to somewhere.
(in this example, threesome gets moved to somewhere only when a = b.)

Similar effects apply when using 'at end' after 'read' and other non-if type conditionals.

My preference is to use as few periods/full stops as possible;
as I write in 'sections', that means just one at the end of a section (apart from the 'required' places, like after a section name.)

The reason for the preference? To avoid false conditional terminators (see above).

While we're at it, I don't like paragraphs, heartily dislike UPPER case, never use 'exit' or 'go' or 'perform thru', can't stand 88-levels and implicit value-assignments like set this-is-a-kludge to value true.

Bout it, really. Except for nested ifs ...... I won't go there.

Regards


Michael

Mayer wrote:
Hello:

I noticed two styles of cobol syntax:

main.
display "hello"
display "goodbye"
stop run
.

vs.

main.
display "hello".
display "goodbye".
stop run.

Some books use the first, others the second. I have no idea what's the
difference between them, but I note the following:

- MF Cobol/DOS allows both

- RM Cobol/DOS allows only the second, i.e., requires a period at the
end of each statement.

Can someone please explain to me the function of the period in cobol,
what is the basis for the difference in syntax, and what is
recommended.

Thanks,

Mayer

.