Within the procedure division, a procedure consists of:
A procedure-name is a user-defined name that identifies a section or a paragraph.
Section-headers are optional after the keywords END DECLARATIVES or if there are no declaratives.
Sections in the declaratives portion must contain priority numbers in the range of 0 through 49.
You cannot specify priority-numbers:
A section ends immediately before the next section header, or at the end of the procedure division, or, in the declaratives portion, at the keywords END DECLARATIVES.
Segments with a priority-number of 0 through 49 are fixed segments. Segments with a priority-number of 50 through 99 are independent segments.
The type of segment (fixed or independent) controls the segmentation feature.
In fixed segments, procedures are always in last-used state. In independent segments, procedures are in initial state each time the segment receives control from a segment with a different priority-number, except when the transfer of control results from the execution of a GOBACK or EXIT PROGRAM statement. Restrictions on the use of ALTER, SORT, and MERGE statements in independent segments are described under those statements.
Enterprise COBOL does not support the overlay feature of the Standard COBOL 85 segmentation module.
Paragraphs must be preceded by a period because paragraphs always follow either the identification division header, a section, or another paragraph, all of which must end with a period.
If there are no declaratives (format 2), a paragraph-name is not required in the procedure division.
A paragraph ends immediately before the next paragraph-name or section header, or at the end of the procedure division, or, in the declaratives portion, at the keywords END DECLARATIVES.
Paragraphs need not all be contained within sections, even if one or more paragraphs are so contained.
Execution begins with the first statement in the procedure division, excluding declaratives. Statements are executed in the order in which they are presented for compilation, unless the statement rules dictate some other order of execution.