You can start Comments, Continuation or Debugging mode(D) in this Indicator Area.
CommentsTo give a comment a line in COBOL, you can give an 'asterisk' i.e. '*' symbol in Column 7
The Syntax of Comment:
|----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
000001 *THIS IS A COMMENT IN COBOL
Example of Comments in the COBOL program
ContinuationIf you are writing a COBOL program and for some reason, you are not able to fit your current code in a line, then you can continue it from the next line by providing a hyphen i.e. '-' symbol in the 7th column. Note: We will discuss Continuation in detail as we will move further.
DebuggingSometimes, we want to debug a COBOL program for the possible list of lines which might be causing an issue so what we do is, we code a character 'D' in 7th column which tells the compiler that this line is used for Debugging purpose. You can code 'D' for suspected lines and once you have found the issue, you can remove the 'D' from the 7th column.
The Syntax of Debugging:
|----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
000001 D
3. Area A
Area A Starts from Column 8 to Column 11.
All Division, Section, Paragraph, Start Declarative, End Declarative, 01 Level number must start in Area A.
Example of Area A
In this sample screenshot, you can see that DIVISION, SECTION and 01 LEVEL starts from Area A.
4. Area B
Area B Starts from Column 12 to Column 72.
All Statement, Sentence, Verbs, Clause, Characters, and Words must start in Area B.
The Sentence is divided into various types of Statements and there can be one or more statements in a sentence.
Let us take all the lines one by one –
Line1 – MOVE “HELLO WORLD” TO WS-HELLO.
This is a Sentence which is also a Statement.
Line2 – MOVE A TO B
This is a Statement.
Line3 – MOVE C TO D
This is also a Statement.
Line4 – COMPUTE E = C + D.
This is also a Statement.
If we combine Line 2, Line 3 and Line 4, then it becomes a Sentence so at the end of a Sentence, we must have a dot(.).
In, MOVE A TO B, MOVE is a verb.
Similarly, COMPUTE E = C + D. -> Here COMPUTE is also a Verb.
Example of Area B
In this sample screenshot, you can see that statement, sentence etc are starting in Area B.