Why does COBOL have both SECTION
and PARAGRAPH
?
Can anybody explain why the designers of COBOL created both SECTION
s and PAR
For one thing, paragraph names must be unique unless they are in separate sections, so sections allow for "namespacing" of paragraphs.
If I recall correctly, the only reason you must use a SECTION
is for DECLARATIVES
. Aside from that they are optional and primarily useful for grouping paragraphs. I think it's common (relatively speaking, anyway) to require that PERFORM
be used on paragraphs only when they are in the same section.