Saturday, January 15, 2011

CHAPTER 1.STRUCTURE OF COBOL

Any COBOL program is mainly divided into 4 Divisions which are Identification, Environment, Data and Procedure Division.

4 DIVISIONS (Mandatory)
          Sections ( User defined & System defined)
                     Paragraphs (User defined & System defined)
                           Sentences ( All are system defined )
                                    Statements ( All are system defined)



CODING FORMAT FOR COBOL PROGRAMS

1        7        12                                                                               72            80
           COL-A                           COLUMN-B

1-6     Page/line numbers – Optional (automatically assigned by compiler) 
7        Continuity (-), Comment (*), Starting a new page (/) Debugging lines (D)
8-11   Column A –Division, Section, Paragraph, 01,77 declarations must begin here. 
12-72 Column B –All the other declarations/statements begin here. 
73-80 Identification field. It will be ignored by the compiler but visible in the source listing.