Pathway/iTS SCREEN COBOL Reference Manual (G06.24+, H06.03+, Pathway/iTS 1.0+)
Procedure Division
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual—426750-001
6-3
Paragraphs
The format of the header is:
A section ends at the next section header, at keywords END DECLARATIVES, or at the
physical end of the Procedure Division.
Paragraphs
A paragraph is used to group related sentences and statements. A paragraph usually has
at least one sentence, but sentences are not required.
For example:
get-all-input.
get-the-first-record.
ACCEPT my-screen...
Reference to a paragraph name permits branching from one area of code to another.
A paragraph begins with a paragraph name in Area A. A paragraph ends immediately
before the next paragraph name or section name, or at the physical end of the Procedure
Division.
Sentences and Statements
A sentence is a string of one or more statements, ending with a period. A statement is a
combination of words and symbols beginning with a SCREEN COBOL verb. For
example:
chk-report-yy.
IF current-yy IS LESS THAN 0 OR GREATER THAN 99
DISPLAY "REPORT YEAR IS NOT BETWEEN 00 AND 99, RE-ENTER "
"YEAR" IN msg-1
ACCEPT current-yy UNTIL my-file1
GO TO chk-report-yy.
Sentences can be grouped into three functional categories:
•
Imperative—Takes an action unconditionally
•
Conditional—Takes an action based on a condition
•
Compiler directing—Uses compiler-directing verbs COPY or USE
An imperative sentence is constructed from one or more imperative statements
terminated by a period. An imperative sentence can have a GO TO statement or an
EXIT PROGRAM statement. If an EXIT PROGRAM statement is present, it must be
the last statement in the sentence.
section-name SECTION.