sign in
 
   
 
 
 
   
  COBOL TUTORIAL FOR BCA STUDENTS OF M G UNIVERSITY  
  UNIT 3: INTRODUCTION TO COBOL . . .  
   
     
  DATA DIVISION  
 

The DATA DIVISION is that part of a COBOL program where every data item processed by the program is described. It is important to note that unless a data item is described in the DATA DIVISION, it cannot be used in the procedure division.

The DATA DIVISION is divided into a number of sections such as FILE SECTION, WORKING-STORAGE SECTION, SCREEN SECTION, LINKAGE SECTION and REPORT SECTION. Depending on the use of a data item, it should be defined in the appropriate section.

The FILE SECTION includes the description of all data items that should be read from or written onto some external file. The data items which are developed internally as intermediate result as well as the constants are described in the WORKING-STORAGE SECTION.

The format of the DATA DIVISION is as follows:

 
   
 
All the section names as well as the division name must be coded as margin A entries. Each section of the DATA DIVISION is optional which means that a section may be omitted if there is no data that may be described in a particular section. It is important to note that the sections to be included must appear in the order shown above.