COBOL Manual for TNS and TNS/R Programs

Procedure Division
HP COBOL Manual for TNS and TNS/R Programs522555-006
8-14
Procedures
Standard COBOL Format
To conform to the COBOL standard, observe these rules. (HP COBOL compilers
do not require that you follow these rules.)
°
If you use sections, put all paragraphs in sections
If the Procedure Division contains sections, put every paragraph in a section.
(This means that if the Procedure Division contains a Declaratives Portion,
which always contains at least one section, then each paragraph in the
Procedure Division must be in a section.)
°
Start each section on a separate line and follow section header immediately by
paragraph header
Start each section on a separate line, with the section-name beginning in
area A and nothing but space characters preceding it.
Independent Segments
An independent segment is a section whose segment-number is greater than 49.
Independent segments are relevant only to the ALTER statement, which you are
advised not to use because the 1985 COBOL standard classifies it as an obsolete
element. (Use a MOVE statement and a conditional GO TO statement instead.)
Procedures
A procedure is a paragraph, a group of successive paragraphs, a section, or a group of
successive sections executed as a unit under the control of a PERFORM statement.
paragraph
is described in Paragraphs.
section
is described in Sections.
There is a distinct difference between procedure-name and procedure. A procedure-
name refers to a paragraph or section in the source program. A procedure-name is
either a section-name or a paragraph-name (which can be qualified by a section-
name). A procedure is a paragraph, a group of successive paragraphs, a section, or a
group of successive sections to be executed as a unit.
section
paragraph
VST415.vsd