You tell PowerCOBOL to use a precompiler by editing the Precompiler properties for each COBOL Script group and each external COBOL file that needs the precompiler.
To access the Precompiler Properties dialog:
In the PowerCOBOL Project Manager, right click on a COBOL Script node or a COBOL File node in the project tree.
From the pop-up menu select Properties.
Select the Compile tab.
Press the Precompiler Set button.
PowerCOBOL displays the Precompiler Properties dialog, shown below:
Where:
Specifies the name of the precompiler executable.
It can be an .EXE file or a .BAT file.
Specifies whether to use the precompiler set in the Execute file field. A preprocessor is executed only when this is checked.
Specifies the parameters to pass to the precompiler. You can include macro strings described in "Macros" below.
For example, if the command line of the precompiler is:
"Execute-file-name -I Input-file -O Output-file"
you would enter the following in the parameter field:
-I %%IN%% -O %%OUT%%
For event procedures contains the name of the COBOL source file that is created when the project is built.
For external COBOL programs contains the name of the COBOL source file.
Displays the name of the file that will be input to the precompiler.
If you do not enter anything in the Suffix field (below), this is the same as the Source file.
If you specify a Suffix, then the Input file name is made by using the Output file name with its extension changed to that specified in the Suffix field.
Use this field to change the extension of the input file for the precompiler. This field should be used when the precompiler only accepts a fixed extension for the input file and that extension is different from the Source file extension.
Specifies the name of the file to be output from the precompiler. This can be passed to the precompiler by using the %%OUT%% macro in the Parameter field.
You can use any of the following macro strings in the Parameter field of the Precompiler Properties dialog.
%%IN%%
Is replaced by the name in the Input file field.
%%InBaseName%%
Is replaced by the name in the Source file field with the extension removed.
%%InDir%%
Is replaced by the path name of the Source file.
%%InSuffix%%
Is replaced by the extension of the Source file.
%%OUT%%
Is replaced by the name in the Output file field.
%%OutDir%%
Is replaced by the path name of the Output file.
%%ProjectDir%%
Is replaced by the path name of the project file (.ppj).
%%WorkDir%%
Is replaced by the path name of the folder used for debugging and building.
When PowerCOBOL builds projects it creates a subfolder to the folder containing the project for each module in the project, using the name of the module. Within that folder it creates either a "debug" or "release" folder depending on the setting of the project's BuildMode property. %%WorkDir%% returns the name of this folder.