General format
Format 1 (with sections)
PROCEDURE DIVISION [USING-phrase] [RETURNING data-name-2].
[ DECLARATIVES.
{ section-name SECTION.
USE statement.
[paragraph-name.
[sentence]...]...}...
END
DECLARATIVES.
]
{section-name SECTION [segment-number].
[paragraph-name.
[sentence]... ]... }...
Format 2 ( without sections)
PROCEDURE DIVISION [USING-phrase] [RETURNING data-name-2].
[sentence]...
[paragraph-name.
[sentence]...]...
where the USING phrase is defined as follows:
USING {[BY REFERENCE] {[OPTIONAL] data-name-1}... | BY VALUE {data-name-1}... }...
Format 3
Only applies to an object, factory or interface definition.
PROCEDURE DIVISION.
[{ method-definition}...]
General rules
The Procedure Division header of a program or method is followed, optionally, by the declarative portion containing declarative procedures (DECLARATIVES), which is followed, in its turn, by normal executable procedures. Each of these procedures consists of statements, sentences, paragraphs, and/or sections in a syntactically valid format.
For a description of the declarative subdivision, see section "DECLARATIVES".
If sections are used within the Procedure Division, format 1 must be applied. Otherwise, format 2 may be used.
A section consists of a section header followed either by zero, one, or more successive paragraphs. (The section header consists of a section-name, followed by the word SECTION and a period; if program segmentation is desired, a space and a segment-number followed by a period may be inserted after the word SECTION.) A section ends immediately before the next section, at the end of the Procedure Division; or in the declaratives subdivision of the Procedure Division immediately before the next section or at the keywords END DECLARATIVES.
Multiple definitions of section-names, or of paragraph-names within a section, are not reported as errors by the compiler as long as they are not referenced.
A paragraph must contain at least a paragraph-name followed by a period and a space, followed by zero, one or more successive sentences. A paragraph ends immediately before the next paragraph or section, or at the end of the PROCEDURE DIVISION, or, in the declaratives portion of the PROCEDURE DIVISION, immediately before the next paragraph or section, or at the keywords END DECLARATIVES.
If one paragraph is in a section, then all of the paragraphs must be in sections.
A sentence consists of one or more statements, optionally separated by semicolons, spaces, or commas, and is terminated by a period, followed by spaces.
A statement consists of a syntactically valid combination of words and symbols, and must begin with a COBOL word.