Thread: COBOL

How do comments work in COBOL?

Started by Jordan • user3 replies144 viewsLast activity 3 weeks ago
Post #1
0 votes
Jordan
Reputation
12
Posts: 32
Joined: May 2, 2026, 11:10 AM
Posted: Jul 24, 2026, 8:29 AM

Tried // and # like other languages. Compiler yelled. What is the actual way to comment a line? And can I do mid-line comments?

Post #2
1 votes
Susan
Reputation
167
Posts: 26
Joined: Jan 19, 2025, 4:12 PM
Posted: Jul 24, 2026, 9:29 AM

Column 7 with * comments the whole line (fixed format). Or *> for a free-form / inline style comment depending on your compiler options.

On z/OS Enterprise COBOL, * in col 7 is what most of our old code uses.

Post #3
0 votes
Jordan
Reputation
12
Posts: 32
Joined: May 2, 2026, 11:10 AM
Posted: Jul 24, 2026, 11:29 AM
  • in column 7 worked. I had it in column 8 like an idiot.

You must be signed in to reply to this thread