Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy does COBOL have both `SECTION` and `PARAGRAPH`?
    text
    copied!<p>Why does COBOL have both <code>SECTION</code> and <code>PARAGRAPH</code>?</p> <p>Can anybody explain why the designers of COBOL created both <code>SECTION</code>s and <code>PARAGRAPH</code>s? These have been around since the initial release of COBOL so I suspect the real reason for their existence has long since gone away (similar to things like <code>NEXT SENTENCE</code> which are still in the language specification for backward compatibility but no longer required since the introduction of explicit scope terminators).</p> <p>My guess is that <code>SECTION</code> may have been introduced to support program overlays. <code>SECTION</code> has an optional PRIORITY number associated with it to identify the program overlay it is part of. However, most modern implementations of COBOL ignore or have dropped PRIORITY numbers (and overlays).</p> <p>Currently, I see that <code>SECTION</code>s are still required in the <code>DECLARATIVE</code> part of the <code>PROCEDURE DIVISION</code>, but can find no justification for this. I see no semantic difference between <code>SECTION</code> and <code>PARAGRAPH</code> other than <code>PARAGRAPH</code> is subordinate to <code>SECTION</code>.</p> <p>Some COBOL shops ban the use of <code>SECTION</code> in favour of <code>PARAGRAPH</code> (seems common in North America). Others ban <code>PARAGRAPH</code> in favour of <code>SECTION</code> (seems common in Europe). Still others have guidelines as to when each is appropriate. All of this seems highly arbitrary to me - which begs the question: Why were they put into the language specification in the first place? And, do they have any relevance today?</p> <p>If you answer this question, it would be great if you could also point to a reference to support your answer.</p> <p>Thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload