COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
such READ statement’s AT END phrase. Both must be provided with scope terminators as
shown in this example:
READ PRIMARY-FILE
AT END READ SECONDARY-FILE
AT END DISPLAY "End of second file"
END-READ
END-READ
• When a delimited-scope statement is contained within another delimited-scope statement with
the same verb, each explicit scope terminator terminates the statement begun by the most
recently preceding, and as yet unpaired, occurrence of that verb. In this example, the first
END-IF ends the second IF statement:
IF A NOT > B
PERFORM PHASE-1
IF A = B
PERFORM PHASE-1X
ELSE
PERFORM PHASE-1Y
END-IF
PERFORM PHASE-2
ELSE
PERFORM PHASE-5
END-IF
Sentences
A sentence is one or more statements terminated by a period separator.
statement
is described in Statements.
A sentence that contains a compiler-directing statement cannot contain any other statements. When
the compiler acts upon the COPY statement, that statement and its terminating period are logically
replaced by whatever text the statement specified. The COPY sentence can therefore appear to
be within another sentence, but once the compiler acts upon the COPY statement, the COPY
sentence itself is replaced by text from a COPY library and the period separator has disappeared.
When you use the delimited-scope statements of COBOL, you can write an entire paragraph with
only one required period—the one at the end of the paragraph.
Paragraphs
A paragraph groups related sentences and statements together and identifies them by one name.
Using the name, GO TO, PERFORM, SORT and MERGE statements can transfer control to the
paragraph.
paragraph-name
is either a COBOL word consisting of up to 30 alphanumeric characters or an integer of up
to 30 digits.
234 Procedure Division










