COBOL Coding SheetCOBOL Introduction COBOL Program Structure
In the olden days, COBOL program needs to be punched on the card and it will be loaded to punch card reader.
For to identify the program coding by the punch card reader, there was a need of coding sheet.
The COBOL coding sheet was a structure to identify from where the COBOL coding statements punched/started writing to differentiate the statements from other.
The COBOL coding structure is known as COBOL Coding sheet.
In now a days, punched cards replaced by editors but the same coding sheet using to code the COBOL programs.
The coding area contains 80 columns for each line/row.
COBOL Coding rules:
On coding forms,
- The first six character positions are reserved for sequence numbers.
- The seventh character position is reserved for the continuation character, or for an asterisk that denotes a comment line.
- The actual program text starts in column 8.
- The four positions from 8 to 11 are known as Area A, and positions from 12 to 72 are Area B.
- All division names, section names, paragraph names, FD entries and 01 level numbers must start in Area A.
- All other sentences must start in Area B.
Below Coding sheet will explain the same in detail..
On coding forms,
1-6 Columns:Both can be combined and will be treated as sequence numbers.
Reserved for page number. Page numbers will be automatically increased along with the lines of code adding to the program.
Reserved for Line number. Line numbers will be automatically increased along with the lines of code adding.
7th Columns:Reserved for special characteristics.
*- Used for commenting a line. If the * is coded on the 7th column in the program, the COBOL compiler will consider as comment instead of code.
-- Used for Continuation of previous line. If – is coded on the 7th column in the program, the COBOL compiler will understand that the current line is continuation of previous line.
/- Used for printer stopper.
D- Debugging indicator. If the D is coded on the 7th column in the program, the COBOL compiler will understand that the current line is used for DEBUGGING purpose which will enabled when DEBUGGING MODE enabled in the program. In all other cases, it will consider as Dummy line.
Is the body of the program where the COBOL programs can be coded.
This COBOL body was divided into two areas.
All the DIVISIONS, SECTIONS, PARAGRAPHS should be coding in AREA A.
Along with the above 01 and 77 level numbers coding also should start from AREA A.
All other Statements, Sentences should be coding in AREA B.
System Generated Number
Used for Identification purpose.
COBOL Compiler will not consider this as a part of the program.
While printing it will be considered to print hence system will consider 80 characters per line for print.
The above example showing how the columns will be in edited member for writing a new program
First six characters reserved for sequence number. The same can be used to write the Requirement/change number to identify the changes related to the change when modifying the existing program.
7th column reserved for the continuation character, or for an asterisk that denotes a comment line.
columns 8 to 72 is available for writing the code of the program.
COBOL Introduction COBOL Program Structure