COBOL Program structure
COBOL compiler accepts the source code in a standard format. There are 80
character positions on each line of source code.
Sequence Number ->
(Optional) use these positions to give sequence number
to the lines of source code.
Use * for commenting the line. Other values can be used in
this position are slash(/) and hyphen(-).
Area A & Area B ->
Contains COBOL source code. ( Position 8 to 72 )
COBOL compiler will ignore the data in these positions.
There are four Divisions in every COBOL programs.
This division contains the information to identify the program. There are
seven paragraph headers in this division. PROGRAM-ID is mandatory, rest
all headers are optional.
Environment Division describe the physical characteristics of input-ouput
data sources used by the program. The Environment Division consists of two
sections of which both are optional. (Configuration Section & Input-Output
All data items used in the program must be defined in Data Division. There
are 3 important sections in this divisions. FILE SECTION, WORKING-STORAGE
SECTION & LINKAGE SECTION.
This is the place where , programmer needs to implement the program logic.