Imperative Statements

An imperative statement either specifies an unconditional action to be taken by the program, or is a conditional statement terminated by its explicit scope terminator (see Delimited Scope Statements). A series of imperative statements can be specified whenever an imperative statement is allowed. 

Table 1 lists COBOL imperative statements.

Table 1. Types of Imperative Statements
Type Imperative Statement
Arithmetic

ADD¹
COMPUTE¹
DIVIDE¹
INSPECT (TALLYING)
MULTIPLY¹
SUBTRACT¹

Data Manipulation

ACCEPT (DATE, DAY, DAY-OF-WEEK, TIME)
INITIALIZE
INSPECT (CONVERTING)
INSPECT (REPLACING)
MOVE
SET
STRING²
UNSTRING²

IBM Extension

XML GENERATE6
XML PARSE6

End of IBM Extension
Ending

STOP RUN
EXIT PROGRAM

IBM Extension

GOBACK

End of IBM Extension
Input⁄Output

ACCEPT⁶ identifier
CLOSE
DELETE³
DISPLAY⁶
OPEN
READ⁴
REWRITE³
SET (for UPSI switches)
START³
STOP literal
WRITE⁵

IBM Extension

ACQUIRE
COMMIT
DROP
ROLLBACK

End of IBM Extension
Ordering

MERGE
RELEASE
RETURN
SORT

Procedure Branching

ALTER
EXIT
GO TO
PERFORM

Subprogram Linkage

CALL⁷
CANCEL

Table Handling SET
Notes to Table 1:
¹
Without the ON SIZE ERROR or NOT ON SIZE ERROR phrase.
²
Without the NOT ON OVERFLOW or ON OVERFLOW phrase.
³
Without the INVALID KEY or NOT INVALID KEY phrase.
Without the AT END, NOT AT END, INVALID KEY, NO DATA, or NOT INVALID KEY phrase.
Without the INVALID KEY, NOT INVALID KEY, END-OF-PAGE, or NOT END-OF-PAGE phrase.
Without the ON EXCEPTION or NOT ON EXCEPTION phrase.
Without the ON OVERFLOW, ON EXCEPTION, or NOT ON EXCEPTION phrase.