I need to compile one of my programs with different compiler options than the rest of the programs in a project. How can I do this either inside the IDE or from the command line?

Question ID : 296
Created on 2018-09-20 at 8:47 AM
Author : Veryant Support [support@veryant.com]

Online URL : http://support.veryant.com/support/phpkb/question.php?ID=296



Inside the IDE

From the IDE there are two possible solutions, using the program's specific properties, or using the IMP OPTION directive.

Using the program properties

Though each project has a set of properties, you can override these at the program level.
For instance, let's say that one program in a project needs to be compiled with the -big compiler option due to the size of the source code.
But the -big compile options should not be used by all the programs in a project, because it may cause a performance problem.

Right click that specific source program and select "Properties", go to "isCOBOL Settings", click on the "B" tab, then select "-big", apply and close the window.

You can do the same for your source program that needs different compile switches than the rest of the project.
The title bar of the properties window will have the name of your program, for example "Properties for MYPROG.cbl".
Modify the settings as you need to, and apply and close the properties window.
You will see an asterisk next to the program name in the structural area:

to denote that this program uses different properties settings than the rest of the project. Everytime you compile your project, this program will use those different settings.

Be aware that these settings belong to the specific project where they were set.
In other words, if you copy or link this program into another project or if you recreate the workspace or share it with other developers via SVN, you will lose these settings and you'll need to manually set them back in the new workspace.

Using the IMP Option Directive

To make a change in compiler options for one program, you can add the IMP OPTION Directive in the very first line of the source code.

For example:

       >>IMP OPTION "-dz #di"
              program-id. eg001.
       ...

Use the - symbol to include a compile options, and the # symbol to remove a compile option.
In the above sample, the program eg001 will be always compiled with the -dz option and will never be compiled with the -di option.

Be aware that there are some compile switches that cannot be used with the IMP OPTION directive.
You can get more information about this in the isCOBOL SDK User's Guide in the Compiler Directives section.

From the command prompt

The second option above, using the IMP OPTION directive, is the best way to customize the compile options for a specific program when you are compiling from a command prompt.



Back to Original Question