Procedure division structure

The PROCEDURE DIVISION is an optional division.

Program procedure division
The program procedure division consists of optional declaratives, and procedures that contain sections, paragraphs, sentences, and statements.
Factory procedure division
The factory procedure division contains only factory method definitions.
Object procedure division
The object procedure division contains only object method definitions.
Method procedure division
A method procedure division consists of optional declaratives, and procedures that contain sections, paragraphs, sentences, and statements. A method can INVOKE other methods, be recursively invoked, and issue a CALL to a program. A method procedure division cannot contain nested programs or methods.

For additional details on a method procedure division, see Requirements for a method procedure division.

Start of change Function procedure division End of change
Start of changeThe function procedure division consists of optional declaratives, and procedures that contain sections, paragraphs, sentences, and statements.End of change
Start of changeFunction prototype procedure divisionEnd of change
Start of changeThe function prototype procedure division consists only of the function prototype division header. No declaratives, sections, paragraphs, sentences, or statements are allowed. A function prototype procedure division cannot contain nested programs or functions. The function prototype procedure division is required in the definition of a function prototype.End of change

Format: procedure division

Read syntax diagramSkip visual syntax diagramprocedure-division-headerfactory-or-object-procedure-division-headermethod-procedure-division-headerfunction-division-headerfunction-prototype-procedure-division-headerDECLARATIVES.sect.use-statement1paraEND DECLARATIVES.section-name2SECTIONpriority-number3.para
sect
Read syntax diagramSkip visual syntax diagramsection-nameSECTIONpriority-number3
para
Read syntax diagramSkip visual syntax diagramparagraph-name.sentence
Notes:
  • 1 The USE statement is described under USE statement.
  • 2 Section-name can be omitted. If you omit section-name, paragraph-name can be omitted.
  • 3 Priority-numbers are not valid for methods, recursive programs, or programs compiled with the THREAD option.