This is a brief guide to the syntax of a COBOL program. You can look at the sample program to see how it all fits together. There are also some links to more detailed entries.
Every COBOL program has four divisions.
These must appear in the order given above. Each DIVISION may be divided into sections. Each section may be further divided into paragraphs.
COBOL inherits rules about the layout of the program text from the days when computer programs were input on punched cards. Since a deck of cards could easily be dropped each card had to be numbered. Thus the first six (6) columns of each line are reserved for line numbers. Since some systems expected line numbers at the end of the line as well columns 73-80 are also reserved for identification. Furthermore if the character in column seven (7) is an asterisk (*) the line is ignored by the compiler. Such line are called comment lines. They are used to let the programmer know what the current section of the code is for. They can also be used to space the source code and make it more readable.
Thus only text in columns 8-72 are part of the program proper. There is another distinction within each line. Columns 8-11 are called AREA A, and columns 12- 72 AREA B. Division, section and paragraphs names must begin in area A. All other sentences must be confined to area B. A line can continue onto the next provide that the continuation is in area B.