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

5.1 Data Division Overview



This overview describes the structure of the Data Division for programs,
X classes, and methods. Each section in the Data Division has a specific
X logical function within a COBOL source program or method and can be omitted when that logical function is not needed. If included, the sections must be written in the order shown. The Data Division is optional.

Program Data Division
The Data Division of a COBOL source program describes, in a structured manner, all the data to be processed by the object program.


X Class Data Division

X The Class Data Division section contains data description entries for
X object-instance data. The Class Data Division contains only the
X Working-Storage Section.


X Method Data Division

X A method has two visible Data Divisions: the Class Data Division and
X the Method Data Division. If the same data-name is used in both the
X Class Data Division and the Method Data Division, when a method
X references the data-name, the data-name in the Method Data Division
X takes precedence.


    ___ Format--Program  and Method  Data Division ______________________________________________ 
   |                                                                                             |
   | >>__DATA DIVISION.________________________________________________________________________> |
   |                                                                                             |
   | >__ _____________________________________________________________________________ ________> |
   |    |                <__________________________________________________________  |          |
   |    |_FILE SECTION.____ ______________________________________________________ _|_|          |
   |                       |                         <__________________________  |              |
   |                       |_file-description-entry____record-description-entry_|_|              |
   |                                                                                             |
   | >__ _______________________________________________________________ ______________________> |
   |    |                           <_________________________________  |                        |
   |    |_WORKING-STORAGE SECTION.____ _____________________________ _|_|                        |
   |                                  |_record-description-entry____|                            |
   |                                  |_data-item-description-entry_|                            |
   |                                                                                             |
   | >__ _________________________________________________________________ ____________________> |
   |    |                           <___________________________________  |                      |
   |    |_ LOCAL-STORAGE SECTION. ____ _______________________________ _|_|                      |
   |                                  |_ record-description-entry ____|                          |
   |                                  |_ data-item-description-entry _|                          |
   |                                                                                             |
   | >__ _______________________________________________________ _____________________________>< |
   |    |                   <_________________________________  |                                |
   |    |_LINKAGE SECTION.____ _____________________________ _|_|                                |
   |                          |_record-description-entry____|                                    |
   |                          |_data-item-description-entry_|                                    |
   |                                                                                             |
   |_____________________________________________________________________________________________|

 X  ___  Format--Class Data Division _____________________________________________ 
 X |                                                                              |
 X | >>__ _________________________________________________________________ ___>< |
 X |     |                            <_________________________________   |      |
 X |     |__WORKING-STORAGE SECTION.____ _____________________________ _|__|      |
 X |                                    |_record-description-entry____|           |
 X |                                    |_data-item-description-entry_|           |
   |                                                                              |
   |______________________________________________________________________________|

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.