Library View Topics Framed Contents Revised Topics Previous Topic Next Topic Search Search ResultsPrevious Topic MatchNext Topic Match Notes List Notes Print Download No PDF Handheld DisconnectedHandheld ConnectedHelp

6.1.4 Procedures

Within the Procedure Division, a procedure consists of:

A procedure-name is a user-defined name that identifies a section or a paragraph.

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.

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.

Sections in the declaratives portion must contain priority numbers in the range of 0 through 49.

X You cannot specify priority-numbers:

  • 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 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.

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 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.

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.

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.

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 unpredictable.

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.

The end of the Procedure Division is indicated by one of the following:

  • 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

Previous Topic Next Topic Copyright IBM Corp. 1991, 1998

IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.

Return to library:   z/OS | z/OS.e | TPF | z/VSE | z/VM | IBM Hardware | IBM System z Redbooks
Glossary:   IBM terminology
Publications:   How to order publications
Readers:   Download IBM Library Reader | Download IBM Softcopy Reader | Download Adobe® Acrobat® Reader®
Library management:   Download IBM Softcopy Librarian
Contacts:   Contact z/OS

Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.