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.
| Type | Imperative Statement |
|---|---|
| Arithmetic | ADD1 |
| Data Manipulation | ACCEPT (DATE, DAY, DAY-OF-WEEK, TIME) IBM Extension IBM Extension
XML GENERATE6 End of IBM Extension |
| Ending | STOP RUN IBM Extension IBM Extension GOBACK End of IBM Extension End of IBM Extension |
| Input/Output | ACCEPT6 identifier IBM Extension IBM Extension
ACQUIRE End of IBM Extension |
| Ordering | MERGE |
| Procedure Branching | ALTER |
| Subprogram Linkage | CALL7 |
| Table Handling | SET |
- 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.