Coding sheet
During the initial days of COBOL development, COBOL programs are punched on a card and loaded into the punch card reader. The punch card reader reads the code from the card and loads it as a program. From there, the program compilation and execution are taken care of. The code identification process using a card reader needed a standard structure that should be the same everywhere. The standard structure designed to punch the programs is the COBOL Coding sheet.
What is Coding Sheet?
COBOL coding sheet specifies from where each statement coding should start and how it differentiates from other statements. Nowadays, COBOL editors are used to code programs. However, the same coding sheet is standard, and developers should follow these guidelines while coding the programs.
COBOL coding sheet is also called as COBOL reference sheet. The coding sheet contains 80 columns for each line/row. The below diagram shows the IBM coding sheet -
Coding Sheet Split
A row is divided into multiple parts. The below diagram shows the split up at each column level -
1-6 Columns (Sequence Number Area) -
- The first six columns are reserved for the sequence number.
- The sequence number automatically increases with every addition of a new line.
- COBOL compiler does not consider these columns part of the code.
- Any valid character combination overwrites the sequence number value.
The sequence number area is divided into two parts -
- Page Number(1-3 Columns) - Represents the current page number.
- Line Number(4-6 Columns) - Represents the current line number on the page.
For example -
In real time, developers use these columns to label the code for a project or defect. Because of this usage, the area is also called Tag Area. For example - P67328, D31456, etc.
NUM ON STD COBOL
7th Column (Indicator Area) -
Reserved for special characters. The special symbols are -
Special Character | Description |
---|---|
* | Comment indicator .
If "*" is coded, the COBOL compiler considers that line as a comment.
For example -
|
- | Continuation indicator .
If "-" is coded, the COBOL compiler understands that the current line is a continuation of the previous line.
For example -
|
/ | Print stopper indicator. If "/" is coded, it specifies that the printing should start from the new page.
For example -
|
D | Debugging indicator .
If the "D" is coded, the COBOL compiler understands that line is used for DEBUGGING purposes.
The debugging line is enabled when WITH DEBUGGING MODE is enabled like below. For example -
In all other cases, the line considers as a comment or dummy line. |
8-11 Columns (Area-A) -
- Columns 8 to 11 are called Area-A.
- All DIVISION names, SECTION names, system-defined paragraph names, user-defined PARAGRAPH names, Level numbers (01, 77), DECLARATIVES, END DECLARATIVES, and FD/SD entries coding should start in Area-A.
12-72 Columns (Area B) -
- Columns from 12 to 72 are called Area-B.
- Apart from the above specified in Area-A, all other statements should start in Area-B.
- All entries, sentences, statements, clauses, and continuous lines should start in Area-B.
For example -
Things can code in both Area-A and Area-B -
The below things can begin in either Area-A or Area-B -
- Level Numbers from 02 to 49, 66, 88.
- Comments coded with IDENTIFICATION DIVISION.
- Floating comments.
- Compiler-directive statements EJECT, SKIP1, SKIP2, SKIP3, etc.
- Debugging lines.
- Blank lines. An empty line can be anywhere in a program.
73-80 Columns (System Generated Number) -
- Columns from 73 to 80 are reserved for System Generated Numbers and used for identification purposes.
- COBOL Compiler does not consider these columns as a part of the code.