COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

sentence
is described in Sentences. A sentence ends with a period; therefore, a paragraph ends with
the period at the end of its last sentence.
Example 62 Paragraph With One Sentence
CHK-REPORT-YY.
IF CURRENT-YY IS LESS THAN 0
OR GREATER THAN 99
DISPLAY "REPORT YEAR IS NOT BETWEEN 00 AND 99, "
"REENTER YEAR"
ACCEPT CURRENT-YY
GO TO CHK-REPORT-YY.
Example 63 Paragraph With Several Sentences
CONVERT-REPORT-DATE-TO-SERIAL-DAY.
MOVE CURRENT-YY TO REPORT-SERIAL-YEAR.
MOVE 0 TO DIVIDE-RESULT
LEAP-YEAR.
DIVIDE REPORT-SERIAL-YEAR BY 4
GIVING DIVIDE-RESULT
REMAINDER LEAP-YEAR.
IF LEAP-YEAR EQUAL TO 0
MOVE 1 TO LEAP-YEAR
ELSE
MOVE 0 TO LEAP-YEAR.
ADD CURRENT-DD
DAYS-TO-DATE(CURRENT-MM)
GIVING REPORT-SERIAL-DAYS.
IF REPORT-SERIAL-DAYS IS GREATER THAN 59
ADD LEAP-YEAR TO REPORT-SERIAL-DAYS.
Usage Considerations:
Paragraph Headers Not Restricted to Area A
The HP COBOL compilers accept paragraph headers that do not begin in area A; the compiler
recognizes a statement by its initial verb. When the compiler recognizes the end of a sentence
(by detecting the terminating period) and is prepared to accept another sentence or a
paragraph, it accepts any legal paragraph header or section header whether it begins in
area A or after it.
End of a Paragraph
A paragraph ends immediately before the next paragraph header or section header, at the
end of the Procedure Division, or when it is the last paragraph in the Declaratives Portion of
the Procedure Division, at the keywords END DECLARATIVES.
Multiple Paragraph Headers (Null Paragraphs)
A paragraph header can be followed immediately by another paragraph header:
CHECK-THE-INPUT.
GET-THE-FIRST-RECORD.
READ IN-FILE ...
In this case, CHECK-THE-INPUT is a null paragraph, so
GO TO CHECK-THE-INPUT
is equivalent to
GO TO GET-THE-FIRST-RECORD
Procedure Division Components and Syntax 235