COBOL - Program Structure
- COBOL programs are made up of familiar constructs such as paragraphs, sentences, statements, and clauses.
- These constructs, in turn contain elements such as words, names, verbs, and symbols.
- The hierarchy of a COBOL program is shown in the following diagram.
- Division is a block of code, usually containing one or more sections:
- It starts where the division name is encountered.
- It ends with the beginning of the next division or with the end of the program text.
- A COBOL program is structured to have four divisions at a high level:
-
Identification Division
-
Environment Division
-
Data Division
-
Procedure Division
- Clauses and Statements
Clauses:
Written in Environment and Data Divisions: This specifies an attribute of an entry. A series of clauses, ending with period, is defined as an entry.
Statements:
Written in Procedure Division: Specify an action to be taken by the object program. A series of statements, ending with a period, is defined as a sentence.
If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!