Compiler option to avoid comments in the COBOL program.

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
User avatar
Akshya Chopra
Registered Member
Posts: 77
Joined: Mon May 20, 2013 11:32 pm
Algeria

Compiler option to avoid comments in the COBOL program.

Post by Akshya Chopra »

Hi,

Is there any Compiler option to avoid comments in the COBOL program? I ask so because there is a program in the baseline library of our programs where some lines are left un-commented in between the description of the program but program compiles.
enrico-sorichetti
Global Moderator
Global Moderator
Posts: 826
Joined: Wed Sep 11, 2013 3:57 pm

Re: Compiler option to avoid comments in the COBOL program.

Post by enrico-sorichetti »

why not look Yourself at the manual ? :twisted:
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)
User avatar
trudeaun
New Member
Posts: 1
Joined: Fri Aug 24, 2018 3:19 am

Re: Compiler option to avoid comments in the COBOL program.

Post by trudeaun »

COBOL (IBM's anyway) only has single line comments and no mechanism for extending them to cover multiple lines. If you have uncommented lines between comment lines, the compiler will be attempting to compile the uncommented lines.

Debug lines, which have a D rather than an * in column 7, can be compiled or not depending on whether "WITH DEBUGGING MODE" is specified in the SOURCE COMPUTER paragraph. There's no option to compile comments with a * in column 7.
Regards,
Nicole Trudeau

The postings on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1896
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Compiler option to avoid comments in the COBOL program.

Post by Robert Sample »

Prior to Enterprise COBOL, there was REMARKS paragraph that was part of the IDENTIFICATION DIVISION. Also, if there is a DATE-COMPILED. clause in the IDENTIFICATION DIVISION, anything written until the next COBOL language element will be treated as a comment.

There is no compiler option to avoid comments, however. Review the Programming Guide manual for compiler options.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.”