COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
Table 40 Imperative Verbs (continued)
WRITE
9
SETINSPECTCOMPUTE
2
SORTLOCKFILE
3
CONTINUE
1
Without INVALID KEY or NOT INVALID KEY phrase or else with a scope terminator
2
Without SIZE ERROR or NOT SIZE ERROR phrase or else with a scope terminator
3
HP extension
4
ALLOCATE and FREE are recognized as verbs only when the STANDARD 2002 directive is in effect.
5
In HP COBOL, analogous to CALL but used only to call non-COBOL routines
6
Without OVERFLOW, EXCEPTION, or NOT EXCEPTION phrase or else with a scope terminator
7
Limited to appearing alone in a paragraph conditional statement. This is because it can include phrases that are or are
not executed depending upon the value of a a condition (for example, the delimited-scope IF statement) or upon the
occurrence of an exception (for example, the delimited-scope READ statement).
8
Without AT END, NOT AT END, INVALID KEY, or NOT INVALID KEY phrase or else with a scope terminator
9
Without INVALID KEY, NOT INVALID KEY, END-OF-PAGE, or NOT END-OF-PAGE phrase or else with a scope terminator
An individual delimited-scope statement or a sequence of two or more imperative statements is
considered to be an imperative statement under the rules for statement formation; therefore, when
imperative-statement appears in a statement, it refers to one or more consecutive imperative
statements and/or delimited-scope statements.
Example 58 Imperative Statement
MOVE "Birnham Wood" TO DUNSINANE
Conditional Statement
A conditional statement specifies that the truth value of a condition is to be determined and that
the subsequent action of the run unit depends on this truth value.
Any of these statements is a conditional statement (unless it ends with an explicit scope delimiter):
• An EVALUATE, IF, RETURN, or SEARCH statement
• A READ statement with the AT END or INVALID KEY phrase
• A WRITE statement with the INVALID KEY or END-OF-PAGE phrase
• A DELETE, REWRITE, or START statement with the INVALID KEY phrase
• An arithmetic statement (ADD, COMPUTE, DIVIDE, MULTIPLY, or SUBTRACT) with the SIZE
ERROR phrase
• A STRING or UNSTRING statement with the OVERFLOW phrase
• A CALL statement with the EXCEPTION phrase (or the OVERFLOW phrase, which is obsolete
for the CALL statement)
The NOT AT END, NOT INVALID KEY, NOT END-OF-PAGE, NOT SIZE ERROR, and NOT
EXCEPTION phrases also make their parent statement a conditional statement. There is no NOT
OVERFLOW phrase.
Any conditional statement can be preceded by an imperative statement or any sequence of
statements specified as equivalent to an imperative statement by the rules given in Imperative
Statement.
Unless it is contained within an IF statement, a conditional statement must be the last or only
statement in a sentence; however, any statements listed previously can be written as a
delimited-scope statement. For clarity and convenience, you are encouraged to avoid conditional
statements entirely and use equivalent delimited-scope statements instead.
In Example 59, the period ends both the IF and the AT END phrase. If there were an operation
that the program had to perform after the read operation succeeded, but only when
Procedure Division Components and Syntax 231










