HP 3000 Manuals

Sentences, Statements, and Clauses [ HP COBOL II/XL Reference Manual ] MPE/iX 5.0 Documentation


HP COBOL II/XL Reference Manual

Sentences, Statements, and Clauses 

Within a paragraph, sentences (in the PROCEDURE DIVISION) and entries (in
the IDENTIFICATION, ENVIRONMENT, and DATA DIVISIONs) may appear.  Within
a sentence, in turn, one or more statements can be written.  These items
provide a further syntactic breakdown of your program.  In structure,
they closely resemble their English language counterparts.

A sentence is a sequence of one or more statements, with the last
statement terminated by a period followed by a space.

A statement is a syntactically valid combination of words and symbols,
beginning with a verb such as ADD, READ, or DISPLAY.

An entry is any descriptive set of consecutive clauses terminated by a
separator period and written in the IDENTIFICATION DIVISION, ENVIRONMENT
DIVISION, or DATA DIVISION of a COBOL program.

All of these items are explained further in the descriptions of the
divisions in which they appear.

In Figure 2-2 , the PROCEDURE DIVISION begins with a sentence that
contains a single statement:  MOVE ZEROS TO TOTAL COST. (item 10).
Another example is the sentence shown below, which contains two
statements:

[]
A clause is an ordered set of character strings (sequences of characters) that specify an attribute of an entry in the program. In Figure 2-2 , the IDENTIFICATION DIVISION contains the clauses COBOL-F1D3 (item 11) and ARTHUR-JONES (item 12). Statements and entries may also include phrases and clauses. A phrase is a sequence of one or more consecutive character strings that form a portion of a statement or clause. In the example below, the characters RED-DATA OF COLOR-DATA form a phrase: MOVE RED-DATA OF COLOR-DATA TO FORM-DATA.


MPE/iX 5.0 Documentation