Javatpoint Logo
Javatpoint Logo

COBOL - Coding Sheet

In the earlier days, the COBOL program needs to punch on the card, and it will be loaded to punch card readers.

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

The 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 new editors but the same coding sheet using to code the COBOL programs.

In short, we can say that the COBOL program must be written in a format acceptable to the compilers. There is a total of 80 character positions on each line of a coding sheet.

Character positions are grouped into the following sections:

Positions Field Description
1-6 Columns Numbers Used for the line number for counting lines of code.
7 Indicator It can have (*, -, /). Asterisk(*) is used for comments, Hyphen(-) indicates continuation, slash (/) indicate form feed.
8-11 Area A All COBOL divisions, paragraphs, sections, and some special entries must begin in Area A.
12-72 Area B All COBOL statements must begin in Area B.
73-80 Identification Area This is used for the identification of each line in the code. The programmer can use it as per their needs.


Let's see the example given below, showing a COBOL coding sheet:

COBOL Coding Sheet

When you compile and execute the code, it will display the following output:

COBOL Coding Sheet

Character Set

Characters are the lowest in the COBOL hierarchy, and they cannot be further divided. The following COBOL characters are given below:

S. NO. Characters Description
1. A-Z Alphabets (Upper Case)
2. a-z Alphabets (Lower Case)
3. 0-9 Numeric
4. Space
5. + Plus Sign
6. - Minus Sign or Hyphen
7. * Asterisk
8. / Forward Slash
9. $ Currency (Dollar) Sign
10. , Comma
11. ; Semicolon
12. . Decimal point or period
13. " Quotation Mark
14. ( Right Parenthesis
15. ) Right Parenthesis
16. > Greater Than
17. < Less Than
18. : Colon
19. ' Apostrophe
20. = Equal sign

Character Strings

A character string is a collection of individual characters. A character string can be a:

  • Comment
  • Literal
  • COBOL Word


A comment is called a character string that does not affect the execution of a program. It can be any combination of characters.

There are two types of comments:

Comment Line

We can write the comment line in any column. The compiler does not check a comment line for syntax and use it for documentation.

Comment Entry

Comment entries are those, which are integrated into the optional paragraphs of an identification Division. They are written in Area B, and programmers make use of it for reference.

Let's see one example for types of comments:

It will look like this in your OpenCobolIDE editor.

COBOL Coding Sheet

When you compile and execute the above program, it will display the following output:

COBOL Coding Sheet


Literal is a constant, which we can directly enter in a program. There are two types of literals as given below:

Alphanumeric Literal

Alphanumeric Literals are enclosed in an apostrophe. Length can be up to 160 characters. The beginning and ending of a literal should be the same, either quote or apostrophe.

Valid Invalid
'It is valid' 'It is not valid"
"It is valid" "It is not valid'
'It doesn' 't invalid' 'It doesn't valid'

Numeric Literal

It is a combination of numeric digits from 0 to 9, +, -, or decimal point. Length can be up to 18 characters.

+, - sign cannot be the rightmost character. And decimal point (.) should not appear at the end.

Valid Invalid
200 2,00
+15.9 15.
-3.9 3.9-


COBOL word is a character string that can be a user-defined word or a reserved word.


User-defined words are used to give a name to a file, data, records, paragraphs, and sections. Digits, alphabets, and hyphens are allowed while forming user-defined words. You cannot use COBOL reserved words.

Reserved Words

In COBOL, reserved words are predefined words. Some common reserved words are:

Keywords - e.g., ADD, MOVE, ACCEPT, etc.

Special Characters - e.g., +, - *, <, <=, etc.

Figurative Constants - these are the constant values like ZERO, SPACES, etc. Some Figurative Constants are HIGH VALUES, LOW VALUES, ZERO, SPACES, QUOTES, All literals.

Next Topic#

Help Others, Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA