The PROCEDURE DIVISION header

The PROCEDURE DIVISION, if specified, is identified by one of the following headers, depending on whether you are specifying a program, a factory definition, an object definition, a method definition, a function definition, or a function prototype definition.

The following syntax diagram shows the format for a PROCEDURE DIVISION header in a program.

Format: program procedure division header

Read syntax diagramSkip visual syntax diagramPROCEDURE DIVISIONUSINGBYREFERENCEOPTIONALBYVALUEdata-name-1RETURNINGdata-name-2.

The following syntax diagram shows the format for a PROCEDURE DIVISION header in a factory paragraph or object paragraph.

Format: factory and object procedure division header

Read syntax diagramSkip visual syntax diagramPROCEDURE DIVISION.

The following syntax diagram shows the format for a PROCEDURE DIVISION header in a method.

Format: method procedure division header

Read syntax diagramSkip visual syntax diagramPROCEDURE DIVISIONUSINGBYVALUEdata-name-1RETURNINGdata-name-2

The following syntax diagram shows the format for a PROCEDURE DIVISION header in a user-defined function.

Format: function procedure division header

Read syntax diagramSkip visual syntax diagramPROCEDURE DIVISIONUSINGBYREFERENCEBYVALUEdata-name-1RETURNINGdata-name-2.

The following syntax diagram shows the format for a PROCEDURE DIVISION header in a function prototype.

Format: function prototype procedure division header

Read syntax diagramSkip visual syntax diagramPROCEDURE DIVISIONUSINGBYREFERENCEBYVALUEdata-name-1RETURNINGdata-name-2.