How logic is divided in the PROCEDURE DIVISION
The PROCEDURE DIVISION
of a program is
divided into sections and paragraphs, which contain sentences, statements,
and phrases.
- Section
- Logical
subdivision of your processing logic.
A section has a section header and is optionally followed by one or more paragraphs.
A section can be the subject of a
PERFORM
statement. One type of section is for declaratives. - Paragraph
- Subdivision
of a section, procedure, or program.
A paragraph has a name followed by a period and zero or more sentences.
A paragraph can be the subject of a statement.
- Sentence
- Series of one or more COBOL statements that ends with a period.
- Statement
- Performs
a defined step of COBOL processing, such as adding two numbers.
A statement is a valid combination of words, and begins with a COBOL statement. Statements are imperative (indicating unconditional action), conditional, or compiler-directing. Using explicit scope terminators instead of periods to show the logical end of a statement is preferred.
- Phrase
- A subdivision of a statement.