Page 1 of 1

Comment multiple lines in cobol

PostPosted: Thu Mar 13, 2008 12:53 pm
by aravind
how we can comment multiple lines in cobol.......

Re: Comment multiple lines in cobol

PostPosted: Fri Mar 14, 2008 5:17 am
by dick scherrer
Hello aravind and welcome to the forums,

Put an asterisk in col 7 of each line in a group of comment lines.

There is no comment start/end that i'm aware of.

Re: Comment multiple lines in cobol

PostPosted: Fri Mar 14, 2008 7:30 pm
by aravind
hi thanks for ur answer
but suppose im having 2000 lines of code,if i want to comment all the lines after 1000th line means how i can give,its impossible to put * in every 7th column?.......

Re: Comment multiple lines in cobol

PostPosted: Fri Mar 14, 2008 7:53 pm
by pi17388
there are several source edit/change tools that could do this rather simply...fileaid, ispf/rexx, and even a batch sort (icesort or syncsort) come to mind.

Re: Comment multiple lines in cobol

PostPosted: Fri Mar 14, 2008 8:49 pm
by arunprasad.k
there are several source edit/change tools that could do this rather simply...fileaid, ispf/rexx, and even a batch sort (icesort or syncsort) come to mind.


Try this ISPF command to comment 2000 lines of COBOL code.

1. In the first line give .a in the line number area. (To label it as line number 1)
2. In the last line give .b in the line number area. (To label it as last line)
3. Give the following command in the command line.

C ALL ' ' '*' 7 .a .b


Alternatively, make the point 3 as a REXX edit macro and run it.

Post if you have any questions. Arun.

Re: Comment multiple lines in cobol

PostPosted: Sat Mar 15, 2008 3:55 am
by dick scherrer
Hello,

Will this block of commented code ever be re-activated?

Re: Comment multiple lines in cobol

PostPosted: Sat Mar 15, 2008 11:39 am
by arunprasad.k
I assume that Dick is concerned about reverting the changes done after a period of time.

If you want to uncomment/re-activate the commented code AND if you use '*' in column number 7 to comment a line in your esisting programs, then you can use '/' in column 7 to comment the code for this purpose (just to differentiate the affected line).

But if your programs has both '*' and '/' to comment the line then we might have to thing of a different solution. :roll:

Post if you have any issues. Arun.