Remove comment lines from source

Sometimes trying to read code that has been commented out or changed many times is difficult. You can quickly remove source file comment lines in your source file. I suggest you do this in the development library.

Code: Create an SQL source member with the following statement:

DELETE FROM DEVLIB/QRPGLESRC WHERE substr(srcdta,6,2) = 'C*'

Then do the following command:

OVRDBF FILE(QRPGLESRC) TOFILE(DEVLIB/QRPGLESRC) MBR(PROGRAM) 

Then run the following:
(DEVLIB/QSQLSRC) = substitute with your SQL source LIB/FILE
DELCOMMENT = substitute with the name of the source member you created above

RUNSQLSTM SRCFILE(DEVLIB/QSQLSRC) SRCMBR(DELCOMMENT) COMMIT(*NONE)

This was first published in August 2001

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.