CobolProgramStructure - TypeCobolTeam/TypeCobol GitHub Wiki

Definitions

Sections and paragraphs define a program. Sections and paragraphs are subdivided into sentences, statements, and entries. Sentences are subdivided into statements, and statements are subdivided into phrases. Entries are subdivided into clauses.

Entries

An entry is a series of clauses that ends with a separator period. Entries are constructed in the identification, environment, and data divisions.

Clauses

A clause is an ordered set of consecutive COBOL character-strings that specifies an attribute of an entry. Clauses are constructed in the identification, environment, and data divisions.

Sentences

A sentence is a sequence of one or more statements that ends with a separator period. Sentences are constructed in the PROCEDURE DIVISION.

Statements

A statement specifies an action to be taken by the program. Statements are constructed in the PROCEDURE DIVISION.

Phrases

Each clause or statement in a program can be subdivided into smaller units called phrases.

Hierarchy

The syntactical hierarchy follows this form:

  • IDENTIFICATION DIVISION
    • Paragraphs
      • Entries
        • Clauses
  • ENVIRONMENT DIVISION
    • Sections
      • Paragraphs
        • Entries
          • Clauses
            • Phrases
  • DATA DIVISION
    • Sections
      • Entries
        • Clauses
          • Phrases
  • PROCEDURE DIVISION
    • Sections
      • Paragraphs
        • Sentences
          • Statements
            • Phrases

excerpts from Enterprise COBOL for z/OS, V5.1.1 Language Reference

⚠️ **GitHub.com Fallback** ⚠️