Structural Hierarchy [ HP COBOL II/XL Reference Manual ] MPE/iX 5.0 Documentation
HP COBOL II/XL Reference Manual
Structural Hierarchy
All COBOL programs are organized in a structure that consists of
divisions, sections, paragraphs, sentences, statements, clauses, and
phrases. This structure is hierarchical--that is, as a general rule, a
COBOL program is made up of divisions; a division is made up of sections;
a section is made up of paragraphs; a paragraph is made up of either
sentences or clauses (depending upon the division); a sentence can
contain one or more statements; a statement or clause can contain one or
more phrases. The general hierarchy appears schematically in Figure 2-1
. Those COBOL constructs with English language counterparts
(paragraphs, sentences, clauses, and phrases) generally resemble their
corresponding counterparts. From the standpoint of the compiler, each
construct is treated as a logical entity within your program.
In describing the COBOL constructs, this manual begins with the highest
level construct within a program, and proceeds to the lowest level.
Figure 2-1. COBOL Structure Hierarchy
Figure 2-2 is an example of the COBOL program structure. The numbers
indicate specific parts of the program. They are described in more
detail later in this chapter as "item". For example, under the section
"Division Header Format", the phrase "items 1 through 4" refers to the
circled numbers 1 through 4.
Figure 2-2. Program Structure Example
The items shown in Figure 2-2 are:
1. Identification Division.
2. Environment Division.
3. Data Division.
4. Procedure Division.
5. Working-Storage Section.
6. Program-Id Paragraph.
7. Author Paragraph.
8. A paragraph in the Procedure Division.
9. A user-defined paragraph name.
10. A sentence in the Procedure Division.
11. The program name.
12. The author's name.
MPE/iX 5.0 Documentation