Statement Categories

All COBOL statements are divided into four categories based on their actions, and they are -

  • Imperative Statements
  • Conditional Statements
  • Delimited scope statements
  • Compiler-directing statements

Imperative Statements -

An Imperative Statement is a procedural instruction specifying an action to be taken during the program's execution. It provides the step-by-step process that the program should follow.

For Example - ACCEPT, MOVE, INSPECT, STRING, UNSTRING, All statements without ERROR and EXCEPTION phases, etc.

Conditional Statements -

A Conditional Statement refers to a statement that tests a condition and then executes one or more statements based on the result of that condition. It allows a program to choose the flow of execution between different paths based on the truth value (TRUE or FALSE) of a condition or set of conditions.

For Example - IF, EVALUATE, SEARCH, All statements with ERROR and EXCEPTION phases, etc.

Delimited scope statements -

A Delimited Scope Statement has a clear beginning and end is marked by specific keywords. This type of statement helps in improving the readability and structure of programs by providing a clear scope of where a specific logic starts and ends.

Explicit Scope terminators -

Explicit scope terminators are used to mark the end of a statement or block of code. These are not common and specific only to the statement. For Example - END-IF, END-CALL, END-COMPUTE, etc.

Implicit Scope terminators -

Implicit scope terminator (.) uses to end the statement implicitly and is used to terminate all statements. For Example - Period (.).

Compiler-directive statements -

Compiler-directive statements provide instructions to the compiler about how the source program should be compiled. They don't impact the program exexution but instead it affect the compilation process.

For Example - COPY, EJECT, SKIP, etc.

Learn More?
  • Statement Categories
    • Conditional Statements (Covered in next chapters)
    • Delimited Scope Statements
    • Compiler-directive Statements (Covered in next chapters)