Top
PowerCOBOL V11.0 User's Guide
FUJITSU Software

6.4.1 Configuring PowerCOBOL with a Precompiler

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:

  1. In the PowerCOBOL Project Manager, right click on a COBOL Script node or a COBOL File node in the project tree.

  2. From the pop-up menu select Properties.

  3. Select the Compile tab.

  4. Press the Precompiler Set button.
    PowerCOBOL displays the Precompiler Properties dialog, shown below:

    Figure 6.6 Precompiler Properties dialog window

Where:

Execute file:

Specifies the name of the precompiler executable.
It can be an .EXE file or a .BAT file.

Use this tool:

Specifies whether to use the precompiler set in the Execute file field. A preprocessor is executed only when this is checked.

Parameter:

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%%

Source file:

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.

Input 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.

Suffix:

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.

Output file:

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.

6.4.1.1 Macros

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.