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

ADD1
COMPUTE1
DIVIDE1
INSPECT (TALLYING)
MULTIPLY1
SUBTRACT1

Data Manipulation

ACCEPT (DATE, DAY, DAY-OF-WEEK, TIME)
INITIALIZE
INSPECT (CONVERTING)
INSPECT (REPLACING)
MOVE
SET
STRING2
UNSTRING2

IBM Extension
IBM Extension

XML GENERATE6
XML PARSE6

End of IBM Extension
End of IBM Extension
Ending

STOP RUN
EXIT PROGRAM

IBM Extension

IBM Extension GOBACK End of IBM Extension

End of IBM Extension
Input/Output

ACCEPT6 identifier
CLOSE
DELETE3
DISPLAY6
OPEN
READ4
REWRITE3
SET (for UPSI switches)
START3
STOP literal
WRITE5

IBM Extension
IBM Extension

ACQUIRE
COMMIT
DROP
ROLLBACK

End of IBM Extension
End of IBM Extension
Ordering

MERGE
RELEASE
RETURN
SORT

Procedure Branching

ALTER
EXIT
GO TO
PERFORM

Subprogram Linkage

CALL7
CANCEL

Table Handling SET
Notes to Table 1:
1
Without the ON SIZE ERROR or NOT ON SIZE ERROR phrase.
2
Without the NOT ON OVERFLOW or ON OVERFLOW phrase.
3
Without the INVALID KEY or NOT INVALID KEY phrase.
4
Without the AT END, NOT AT END, INVALID KEY, NO DATA, or NOT INVALID KEY phrase.
5
Without the INVALID KEY, NOT INVALID KEY, END-OF-PAGE, or NOT END-OF-PAGE phrase.
6
Without the ON EXCEPTION or NOT ON EXCEPTION phrase.
7
Without the ON OVERFLOW, ON EXCEPTION, or NOT ON EXCEPTION phrase.