Previous Topic Next topic Print topic


Imperative Statement

An imperative statement indicates a specific unconditional action to be taken . An imperative statement is any statement that is neither a conditional statement nor a COBOL system-directing statement. An imperative statement can consist of a sequence of imperative statements, each possibly separated from the next by a separator.

The imperative verbs are:

  • ACCEPT (1)
  • ADD (2)
  • ALTER
  • CALL (4)
  • CANCEL
  • CLOSE
  • COMPUTE (2)
  • DELETE (3)
  • DISPLAY (1)
  • DIVIDE (2)
  • EXIT
  • GO TO
  • INSPECT
  • MERGE
  • MOVE
  • MULTIPLY (2)
  • OPEN
  • PERFORM
  • READ (5)
  • RELEASE
  • REWRITE (3)
  • SET
  • SORT
  • START (3)
  • STOP
  • STRING (4)
  • SUBTRACT (2)
  • UNSTRING (4)
  • WRITE (6)
1 Without the optional ON EXCEPTION phrase.
2 Without the optional SIZE ERROR phrase.
3 Without the optional INVALID KEY phrase.
4 Without the optional ON OVERFLOW or ON EXCEPTION phrase.
5 Without the optional AT END phrase or INVALID KEY phrase.
6 Without the optional INVALID KEY phrase or END-OF-PAGE phrase.

ANS85 The additional ANSI'85 imperative verbs are:

ANS85 
  • CONTINUE
  • INITIALIZE
 

ISO2002 The additional ISO 2002 imperative verb is:

ISO2002 

The additional OS/VS COBOL imperative verbs are:

  • EXAMINE
  • EXHIBIT
  • GOBACK
  • TRANSFORM

VSC2 The additional VS COBOL II imperative verb is:

VSC2 

MF The additional imperative verbs available to this COBOL system are:

MF 
  • CHAIN
  • EXHIBIT
  • GOBACK
  • NEXT SENTENCE

When "imperative-statement" appears in the general format of statements, "imperative-statement" refers to that sequence of consecutive imperative statements that must be ended by a period or by any phrase associated with a statement containing that "imperative-statement".

OSVS Either the connective word "THEN" or the connective word "AND" can optionally be placed between any two imperative statements which appear in a single sequence of imperative statements.

Previous Topic Next topic Print topic