Within the Procedure Division, a procedure consists of:
A procedure-name is a user-defined name that identifies a section or a
- A section or a group of sections
- A paragraph or group of paragraphs
A section-header optionally followed by one or more paragraphs.
A section-name followed by the key word SECTION, optionally
followed, by a priority-number, followed by a separator period.
X Section-headers are optional after the key words END DECLARATIVES
X or if there are no declaratives.
Sections in the declaratives portion must contain priority numbers
in the range of 0 through 49.
A user-defined word that identifies a section. A referenced
section-name, because it cannot be qualified, must be unique
within the program in which it is defined.
X An integer or a positive signed numeric literal ranging in
value from 0 through 99.
X You cannot specify priority-numbers:
A section ends immediately before the next section header, or at
the end of the Procedure Division, or, in the declaratives
portion, at the key words END DECLARATIVES.
- X In a method definition
- X In a program that is declared with the RECURSIVE attribute
- X In a program that specifies the THREAD compiler option
X (Workstation only)
A paragraph-name followed by a separator period, optionally followed
by one or more sentences.
Note: Paragraphs must be preceded by a period because paragraphs
always follow either the ID Division Header, a Section, or another
paragraph, all of which must end with a period.
A paragraph ends immediately before the next paragraph-name or section
header, or at the end of the Procedure Division, or, in the
declaratives portion, at the key words END DECLARATIVES.
A user-defined word that identifies a paragraph. A
paragraph-name, because it can be qualified, need not be unique.
X If there are no declaratives (format-2), a paragraph-name is not
X required in the Procedure Division.
X As an IBM extension, all paragraphs do not need to be contained within
X sections, even if one or more paragraphs are so contained.
Execution begins with the first statement in the Procedure Division,
excluding declaratives. Statements are executed in the order in which
they are presented for compilation, unless the statement rules dictate
some other order of execution.
One or more statements terminated by a separator period.
A syntactically valid combination of identifiers and symbols
(literals, relational-operators, and so forth) beginning with
a COBOL verb.
The word or words necessary to make unique reference to a
data item, optionally including qualification,
subscripting, indexing, and reference-modification. In
any Procedure Division reference (except the class test),
the contents of an identifier must be compatible with the
class specified through its PICTURE clause, or results are
The end of the Procedure Division is indicated by one of the
- An Identification Division header, which indicates the start of a
nested source program
- The END PROGRAM header
- The physical end of the program; that is, the physical position in
a source program after which no further source program lines occur
© Copyright IBM Corp. 1991, 1998
IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.
Return to library:
IBM Hardware |
IBM System z Redbooks
How to order publications
Download IBM Library Reader |
Download IBM Softcopy Reader |
Download Adobe® Acrobat® Reader®
Download IBM Softcopy Librarian
Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks
of Adobe Systems incorporated.