COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
Example 57 Procedure Division
PROCEDURE DIVISION.
DRIVER SECTION.
DRIVE.
PERFORM 100-INITIALIZATION
PERFORM 200-PROCESS-REQUESTS UNTIL JOB-IS-DONE
PERFORM 300-TERMINATION.
100-INITIALIZATION SECTION.
OPEN-FILES.
OPEN INPUT MESSAGE-IN
OPEN OUTPUT MESSAGE-OUT
OPEN INPUT BASE-FILE.
FINISH-UP-INIT.
MOVE "READY" TO WATCH-WORD.
...
200-PROCESS-REQUESTS SECTION.
READ-DOLLAR-RECEIVE.
READ MESSAGE-IN
...PROCESS-INPUT-DATA.
...
300-TERMINATION SECTION.
CLOSE-AND-QUIT.
CLOSE MESSAGE-IN
MESSAGE-OUT
BASE-FILE
STOP RUN.
Topics:
• Statements
• Sentences
• Paragraphs
• Sections
• Procedures
• Declaratives Portion
Statements
A statement is a syntactically valid combination of words and symbols beginning with a COBOL
verb. Where a statement ends depends on its context.
Table 38 Where Statements End
Statement ends …Statement is …
immediately before the verb of the next statementin a sequence of statements and is not the last one
either immediately before the keyword that begins the next
portion of a containing statement or at the period separator
that terminates its containing sentence
inside another statement
See Scope of Statements.isolated or the last statement in a sequence
Procedure Division Components and Syntax 229










