In the olden days, the COBOL program needs to be punched on the card, and it will be loaded to the punch card reader.

There was a need for a coding sheet to identify the program coding by the punch card reader.

The COBOL coding sheet was a structure to identify from where the COBOL coding statements punched/started writing to differentiate the statements from others.

In nowadays, punched cards are replaced by editors, but the same coding sheet using to code the COBOL programs.

The COBOL coding structure is known as the COBOL Coding sheet or COBOL reference sheet.

One should write the COBOL source code as per the guidelines set in the COBOL coding sheet. The coding sheet contains 80 columns for each line/row.

The below diagram clearly shows the coding sheet row split up at each column level -

COBOL Punched Card

The below diagram clearly shows the coding sheet row splitup at each column level -

Coding sheet

On coding forms,

Positions Description
1 - 6 Sequence number area
7 Indicator area.
Reserved for one of the below characters -
  • Print character (/ - forward slash)
  • Continution Chatacter (-)
  • Comment character (* - Asterisk)
  • Debugging Character (D)
8 - 11 Area A.
All division names, section names, paragraph names, FD entries and 01 level numbers coding should start in this area.
12 - 72 Area B.
All other sentences coding should start in this area except the above specified in Area-A.
73 - 80 System-generated number area.

1-6 Columns (Sequence Number Area) -

  • A total of six columns are reserved for sequence number.
  • The sequence number can be a combination of any valid computer character.
  • Sequence number automatically gets increased on every addition of a new line.
  • One can overwrite the sequence number area to label a project or defect. Due to this, the area is also called as a Tag Area.

    For example - In the real-time environment, if we are inserting a code for some project number 67328/ defect number 31456, it can be coded in the sequence area like below for identifying the code easily -
    P67328     MOVE A TO B.                                                 
    P67328     MOVE C TO D.          
    D31456     MOVE A TO B.                                                 
    D31456     MOVE C TO D.          
  • These six columns are divided into two parts -
    • Page Number(1-3 Columns)
    • Line Number(4-6 Columns)

1-3 Columns (Page Number) -

  • Represents the page number.
    For example -
    Codingsheet program Code

4-6 Columns (Line Number) -

  • Represents the line number.
    For example -
    Codingsheet program Code
Tip! To add the sequence number automatically to COBOL program, execute the below command in the code editor.

7th Column (Indicator Area) -

Reserved for special characters. Those special characters are -

  • * - Commenting indicator.
  • - - Continution indicator.
  • / - Printer stopper indicator.
  • D - Debugging inicator.
Codingsheet program Code
  • "*" → "*" used for commenting a line. If the "*" is coded on the 7th column of a line, the COBOL compiler considers that line as a comment.
    For example -
    000005* THIS IS COMMENT LINE   
  • "-" → "-" used for continuation of the previous line. If "-" is coded on the 7th column of a line, the COBOL compiler understands that the current line is a continuation of the previous line.
    For example -
    000002-      "LITERAL SPREAD ON TWO LINES".    
  • "/" → "/" used for printer stopper and specifies that the printing should start from new page.
    For example -
  • "D" → "D" is used as a debugging indicator. Suppose the "D" is coded on the 7th column of a line; the COBOL compiler understands that line is used for DEBUGGING purposes. The line is enabled when DEBUGGING MODE is enabled in the program. In all other cases, the line considers as a comment or dummy line.
    For example -
    ***************************** Top of Data ******************************
    000001 IDENTIFICATION DIVISION.                                         
    000002 PROGRAM-ID. CODSHEET.                                            
    000003 AUTHOR. MTH.                                                     
    000004 SOURCE-COMPUTER. IBM-370 WITH DEBUGGING MODE.                    
    000005 OBJECT-COMPUTER. IBM-370.                                        
    000007 PROCEDURE DIVISION.                                              

8-72 Columns (Program Coding Area) -

Represents the coding area of the program where actual coding starts and ends. The COBOL body was divided into two areas -

  • 8-11 Columns (Area A)
  • 12-72 Columns (Area B)

8-11 Columns (Area A) -

Columns from 8 to 11 are called as AREA A.

All the DIVISION headers, SECTION headers, PARAGRAPH headers, PARAGRAPH names, Level number (01, 77, FD and SD), DECLARATIVES, END DECLARATIVES, and FD entries coding should start in AREA A.

Codingsheet program Code

12-72 Columns (Area B) -

Columns from 12 to 72 are called as AREA A.

Apart from the above sentences specified in AREA A, all other statements should start in AREA B. All entries, sentences, statements, clauses, and continuous lines should code in Area B.

Codingsheet program Code

Objects can written in both Area-A and Area-B -

Below objects can begin in either Area A or Area B.

73-80 Columns (System Generated Number) -

Columns from 73 to 80 are reserved for System Generated Number and used for identification purposes.

COBOL Compiler does not consider this as a part of the program.

While printing the program, these columns consider for printing because the system recognizes 80 characters per line.

Codingsheet program Code

Practical Example -

Scenario - Below example describes how the coding sheet look like along with code.

Code -

Codingsheet program Code
***************************** Top of Data **************************************
000001 IDENTIFICATION DIVISION.                                         00010000
000002 PROGRAM-ID. CODSHEET.                                            00020000
000003 AUTHOR. MTH.                                                     00030001
000004                                                                  00040001
000005 PROCEDURE DIVISION.                                              00050001
000006                                                                  00060001
000007     DISPLAY "CODING SHEET STRUCTURE DEMO".                       00070001
000008     STOP RUN.                                                    00080001
**************************** Bottom of Data ************************************