sign in
 
   
 
 
 
   
  COBOL TUTORIAL FOR BCA STUDENTS OF M G UNIVERSITY  
  UNIT 3: INTRODUCTION TO COBOL . . .  
   
  BASIC STRUCTURE OF A COBOL PROGRAM  
     
 
Every COBOL program must have the following 4 divisions in the order in which they are specified below:

1. Identification division
2. Environment Division
3. Data Division
4. Procedure Division

In the Identification division the details about the author, date of writing the program etc. will be specified. In the Environment division, the details about the computer environment under which the program was written and compiled etc will be notified. In the Data division, the variables that are used by the program will be defined and it is an important division for the program.

In the procedure division, all the programming statements (Executable Cobol statements) will be written and it is the most important division. Under the divisions there are various sections intended for specific purposes. To name a few, working-storage section and File section come under Data division. Their purpose will be to allocate memory space for the variables and to notify the files that are to be used with the program. A statement of a COBOL program can be written in one or more coding lines. To continue in the next line one has to use a hyphen (-) in column 7.

 
   
  CHARACTER SET  
     
 
To learn any language, first one must know the alphabets of the language and they are known as character set in general. There are 51 different characters in COBOL character set.

They are listed below:
 
 
0-9
(10 numerals)
A-Z
(26 English alphabets-only capital letters)
(minus sign or hyphen)
+
(Plus sign)
*
(Asterisk)
/
(Slash)
=
(Equal sign)
$
(Currency sign)
,
(Comma)
;
(Semi colon)
.
(Period or decimal point)
(Quotation mark)
(
(Left Parenthesis )
)
(Right Parenthesis)
>
(Greater than symbol)
<
(Less than symbol)
b
(Blank Space)
 
 
The characters 0-9 are called Numeric Characters or Digits. The characters A-Z are called Letters and the remaining characters are called special characters. The space or blank character in certain cases is treated as a letter.