Adding and Removing Comments

A typical COBOL file can have several debugging statements that you might want to remove before building your project. This requires you to add comments to a single or multiple lines of code by performing a designated key press. To add comments in COBOL, place an asterisk (*) in the seventh column.

To add or remove comments, do the following:

  1. Place your cursor on a line of code or select multiple lines of code.

  2. Press Ctrl+/.

An asterisk (*) is placed in the seventh column indicating that the a comment is added to the code. Pressing Ctrl+/ again toggles the commenting action on the selected lines of code on which the cursor is placed.  

Notes: