COBOL Manual for TNS and TNS/R Programs
Source Program Organization and Format
HP COBOL Manual for TNS and TNS/R Programs—522555-006
2-2
Source Program Components
Source Program Components
The components of a COBOL source program must appear in the order shown in 
Table 2-1.
The END PROGRAM statement has this syntax:
Table 2-1. Source Program Components
Component
Required or 
Optional? Purpose
Explained 
in Section
Identification Division Required
•
To specify the program name 
(required)
•
To specify your name, the date, 
and the program purpose 
(optional)
5
Environment Division Optional To describe the program’s 
equipment and processing options 
and name the files it uses (you must 
change this information when you 
move a COBOL program to an HP 
system from another type of 
system)
6
Data Division Optional To define the data that the program 
uses (reserve data storage; define 
data formats, types, and structures; 
complete file descriptions)
7
Procedure Division Optional To specify the program activity (the 
data processing)
8
END PROGRAM 
statement
Depends—
see Purpose
To mark the end of the program
If you submit only one program to 
the compiler at a time, the END 
PROGRAM statement is optional. If 
you compile several programs (one 
after another or nested), the END 
PROGRAM statement is required 
for each program except the one 
that ends last. You can use an 
ENDUNIT directive instead of an 
END PROGRAM statement.
2
PROGRAM
.
program-name
END
VST374.vsd










