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 Procedure Division Structure




X The Procedure Division is optional in a COBOL source program, class
X definition, and method definition.

Program Procedure Division
A program Procedure Division consists of optional declaratives, and procedures that contain sections and/or paragraphs, sentences, and statements.


X Class Procedure Division

X The class Procedure Division contains only method definitions. All
X methods introduced in a COBOL class compilation unit must be defined
X in that compilation unit's Procedure Division.


X Method Procedure Division

X A method Procedure Division consists of optional declaratives, and
X procedures that contain sections and/or paragraphs, sentences, and
X statements. A method can INVOKE other methods, be recursively
X INVOKEd, and issue a CALL to a program. A method Procedure Division
X cannot contain nested programs or methods.


X For additional details on a method Procedure Division, see
X "Requirements for a Method Procedure Division" in topic 6.1.1.


    ___ Format--Program and  Method  Procedure Division ____________________________________ 
   |                                                                                        |
   | >>__PROCEDURE DIVISION__ ___________________________ __._____________________________> |
   |                         |_procedure division header_|                                  |
   |                                                                                        |
   | >__ ______________________________________________________________________ __________> |
   |    |                <________________________________                     |            |
   |    |_DECLARATIVES.____| sect |__.__USE__ __________ _|__END DECLARATIVES._|            |
   |                                         |_| para |_|                                   |
   |                                                                                        |
   |    <___________________________________________________________________                |
   |                   (1)                                                  |               |
   | >____section-name_____SECTION__ ____________________ __.__ __________ _|____________>< |
   |                                |                 (2)|     |_| para |_|                 |
   |                                |_priority-number____|                                  |
   |                                                                                        |
   | sect:                                                                                  |
   | |__section-name__SECTION__ ____________________ _____________________________________| |
   |                           |                 (2)|                                       |
   |                           |_priority-number____|                                       |
   |                                                                                        |
   | para:                                                                                  |
   |    <___________________________________                                                |
   | |____paragraph-name.__ ______________ _|_____________________________________________| |
   |                       | <__________  |                                                 |
   |                       |___sentence_|_|                                                 |
   |                                                                                        |
   | Notes:                                                                                 |
 X | (1)  As an IBM extension, section-name can be omitted.  If you omit section-name,      |
 X |      paragraph-name can be omitted.                                                    |
   |                                                                                        |
 X | (2)  Priority-numbers are not valid for methods, recursive programs, or (on AIX, OS/2, |
 X |      and Windows) programs compiled with the THREAD option.                            |
   |                                                                                        |
   |________________________________________________________________________________________|


 X  ___ Format--Class Procedure Division ___________________________________ 
 X |                                                                        |
 X | >>__PROCEDURE DIVISION.__ _______________________ __________________>< |
 X |                          | <___________________  |                     |
 X |                          |___method-definition_|_|                     |
   |                                                                        |
   |________________________________________________________________________|

Subtopics:



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.