Statements and Sentences

A COBOL statement is always introduced by a reserved word called a verb. A verb and its operands describe some action to be taken when the program runs. A sentence is one or more statements that are terminated by a period.

There are four types of statements:

  1. Compiler-directing statements specify an action to be taken by the compiler. Only the COPY, REPLACE, and USE statements fit this classification.
  2. Imperative statements specify an unconditional action to be taken by the object program. Whenever an imperative statement is allowed, it may consist of a sequence of consecutive imperative statements.
  3. Conditional statements specify an action to be taken by the object program that is dependent on the truth value of some condition.
  4. Delimited-scope statements specify their explicit scope delimiter. A delimited-scope statement contains elements of a conditional nature. Because of the scope-delimiter, however, these statements may be used anywhere an imperative statement may be.

An imperative sentence is one that contains only imperative and delimited-scope statements. A conditional sentence consists of a single conditional statement optionally preceded by a sequence of imperative statements.

Several verbs can be either imperative, conditional, or delimited-scope. For example, a simple READ statement is imperative. If the AT END clause is included, it becomes conditional. On the other hand, if the END-READ phrase is also included, then it is a delimited-scope statement.