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:
Place your cursor on a line of code or select multiple lines of code.
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:
If you select a commented line of code plus a new line of code, which has no comments and press Ctrl+/, an asterisk appears in the seventh column of the line of code with no comments and the previously commented code shows another instance of an asterisk in the eight column. However, removing comments moves the asterisk back to the seventh column.
While adding comments, if the '*', '/' or 'D' characters are present in the seventh column, they move to the eight column. However, removing these comments moves these characters back to seventh column.