Rational Developer for System z
COBOL for Windows, Version 7.5, Language Reference


Procedure division structure

The procedure division is an optional division.

Program procedure division
The 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.

Format: procedure division
Read syntax diagramSkip visual syntax diagram>>-+-procedure-division-header-------------------+-------------->
   +-factory-or-object-procedure-division-header-+  
   '-method-procedure-division-header------------'  
 
>--+-------------------------------------------------------------------------------------+-->
   |                .-----------------------------------------------.                    |  
   |                V                            (1)                |                    |  
   '-DECLARATIVES.----| sect |--.--use-statement-------+----------+-+--END DECLARATIVES.-'  
                                                       '-| para |-'                         
 
   .-----------------------------------------------------------------------.  
   V              (2)                                                      |  
>----section-name-------SECTION--+----------------------+--.--+----------+-+-><
                                 |                 (3)  |     '-| para |-'    
                                 '-priority-number------'                     
 
sect:
 
|--section-name--SECTION--+----------------------+--------------|
                          |                 (3)  |  
                          '-priority-number------'  
 
para:
 
   .-----------------------------------.  
   V                                   |  
|----paragraph-name.--+--------------+-+------------------------|
                      | .----------. |    
                      | V          | |    
                      '---sentence-+-'    
 

Notes:
  1. See the USE statement under "Compiler-directing statements."
  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.

Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)