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.

A series of imperative statements can be specified wherever an imperative statement is allowed. A conditional statement that is terminated by its explicit scope terminator is also classified as an imperative statement.

For more information about explicit scope terminator, see Delimited scope statements.

The following lists contain the COBOL imperative statements.

Arithmetic

  • ADD1
  • COMPUTE1
  • DIVIDE1
  • MULTIPLY1
  • SUBTRACT1

1. Without the ON SIZE ERROR or the NOT ON SIZE ERROR phrase.

Data movement

  • ACCEPT (DATE, DAY, DAY-OF-WEEK, TIME)
  • INITIALIZE
  • INSPECT
  • Start of changeJSON GENERATE3End of change
  • MOVE
  • SET
  • STRING2
  • UNSTRING2
  • XML GENERATE3
  • XML PARSE3

2. Without the ON OVERFLOW or the NOT ON OVERFLOW phrase.

3. Without the ON EXCEPTION or NOT ON EXCEPTION phrase.

Ending

  • STOP RUN
  • EXIT PROGRAM
  • EXIT METHOD
  • GOBACK

Input-output

  • ACCEPT identifier
  • CLOSE
  • DELETE4
  • DISPLAY
  • OPEN
  • READ5
  • REWRITE4
  • START4
  • STOP literal
  • WRITE6

4. Without the INVALID KEY or the NOT INVALID KEY phrase.

5. Without the AT END or NOT AT END, and INVALID KEY or NOT INVALID KEY phrases.

6. Without the INVALID KEY or NOT INVALID KEY, and END-OF-PAGE or NOT END-OF-PAGE phrases.

Ordering

  • Start of changeALLOCATEEnd of change
  • Start of changeFormat 1 SORTEnd of change
  • Start of changeFREEEnd of change
  • MERGE
  • RELEASE
  • RETURN7

7. Without the AT END or NOT AT END phrase.

Procedure-branching

  • ALTER
  • CONTINUE
  • Format 1 EXIT
  • GO TO
  • PERFORM

Program or method linkage

  • CALL8
  • CANCEL
  • INVOKE

8. Without the ON OVERFLOW phrase, and without the ON EXCEPTION or NOT ON EXCEPTION phrase.

Table-handling

  • Start of changeFormat 2 SORT (table SORT)End of change
  • SET