To invoke the precompiler during build for a COBOL project, Precompiler must be set for Build Tools.
Adding Precompiler to build tools
If Precompiler is not specified for the Build Tools, follow the procedure below, and select Precompiler.
Select the project in the "Dependency" or "Structure" view.
Select "Property..." from the context menu. The property dialog box appears.
Select "Build Tools" in the left pane. The "Build Tools" page is displayed.
Click the "Add Build Tool..." button. The "Add Build Tool" dialog box appears.
Select "Precompiler", and then click the "OK" button.
Confirm that Precompiler has been added to the "List of build tools associated with COBOL Builder" on the "Build Tools" page, and then click the "OK" button in the property dialog box.
Deleting Precompiler from build tools
To delete Precompiler from a COBOL project:
Select the project from the "Dependency" or "Structure" view.
Select "Property..." from the context menu. The property dialog box appears.
Select "Build Tools" in the left pane. The "Build Tools" page is displayed.
Select "Precompiler "from "List of build tools associated with COBOL builder" on the "Build Tools" page, and click the "Remove" button.
Confirm that Precompiler has been deleted from "List of build tools associated with COBOL builder", and click the "OK" button in the property dialog box.
Note
If a precompiler input source is registered in the "Source Files" folder, Precompiler cannot be deleted from "Build Tools". Delete the precompiler input source from the "Source Files" folder before deleting Precompiler from "Build Tools".
Information can be set and changed for the precompiler command used to build COBOL projects. Existing precompiler link settings are used as the defaults.
Setting and changing precompiler link information
Follow the procedure below to set or change precompiler information for a COBOL project.
Select the project in the "Dependency" or "Structure" view.
Select "Property..." from the context menu. The property dialog box appears.
Select "Build Tools" > "Precompiler" in the left pane. The "Precompiler" page is displayed.
Example
Examples of settings for the Oracle precompiler
INAME=%INFILE% ONAME=%OUTFILE%Description
For details on the "Precompiler" page, see "6.2.1 Setting and changing initial values of precompiler link information".
Note
If a precompiler input source is registered in the "Source Files" folder, no change can be made in "Precompiler source extension" on the "Precompiler" page. Delete the precompiler input source from the "Source Files" folder before making a change in "Precompiler source extension".
To add a precompiler input source to a project, precompiler link information must be set in the project in advance. The precompiler input source must be registered in the Source Files folder of the COBOL project. The following two methods can be used to register a precompiler input source in the Source Files folder:
Create a precompiler input source and registering the new source
Register an existing precompiler input source
Creating a precompiler input source and registering the new source in the Source Files folder
To create a precompiler input source and register the new source in the "Source Files" folder, use the COBOL Source generation wizard or the Object-Oriented COBOL Source generation wizard. Check the "Use precompiler" check box on the first page of the wizard. Then, the created COBOL source or object-oriented COBOL source is registered as a precompiler input source in the "Source Files" folder.
To start the wizard:
In the "Dependency" or "Structure" view, select the Source Files folder of the COBOL project.
Select "File" > "New" > "COBOL Source" or "Object-Oriented COBOL Source" from the menu bar, or select "New" > "COBOL Source" or "Object-Oriented COBOL Source" from the context menu. The wizard is started.
Note
If no precompiler link information is set for the project, the check box for "Use precompiler" is disabled. Set the precompiler link information, and then restart the wizard.
Registering an existing precompiler input source in the Source Files folder
An existing precompiler input source can be registered in the "Source Files" folder of a COBOL project.
For a precompiler input source inside a project:
To add a precompiler input source that is inside a project:
Select the "Source Files" folder in the "Dependency" or "Structure" view.
Select "Add File..." from the context menu. The "Add Source Files" dialog box corresponding to the selected project appears.
Select the precompiler input source to be added to the "Source Files" folder.
Click the "OK" button. The selected precompiler input source is registered in the "Source Files" folder.
For a precompiler input source outside a project:
Use either of the following methods to add a precompiler input source that is outside a project:
Using Windows Explorer, select the precompiler input source to be registered, and then select "Copy" from the context menu. Select the "Source Files" folder, and then select "Paste" from the context menu.
Using Windows Explorer, drag and drop the precompiler input source onto the "Source Files" folder.
Note
If no precompiler link information is registered for the project concerned, an error occurs. The file is registered in the Source Files folder, but it is not registered as a precompiler input source. In this state, even if precompiler link information is set for the project, the file added by the above operation is not automatically registered as a precompiler input source. Move it from the Source Files folder to the Other Files folder then register the file in the Source Files folder again.
To edit the contents of a precompiler input source with the COBOL editor, the extension of the precompiler input source file must be associated with the Content Types and COBOL editor. The association is invoked automatically when the Precompiler setting is set. If the precompiler input file is not opened by the COBOL editor, follow the procedure below and associate the file extension with the Content Types and COBOL editor.
Select "Window" > "Preferences" from the menu bar. The "Preferences" dialog box appears.
In the left pane of the "Preferences" dialog box, select "General" > "Content Types". This displays the "Content Types" page.
In the "Content Types" page, select "Text" > "COBOL Source File".
Click the "Add" button, The "Add Content Type Association" dialog box displays.
In the "Add Content Type Association" dialog box, enter the extension of the precompiler input source file at "Content type" and click the "OK" button.
In the "Content Types" page, check that the extension of the precompiler input source file is displayed at "File associations", and click the "OK" button.
Select "General" > "Editors" > "File Associations" in the left pane of the "Preferences" dialog box. The "File Associations" page is displayed.
Click the "Add..." button to the right of File types on the "File Associations" page. The "Add File Type" dialog box appears.
Enter the extension of the precompiler input source file in "File type" in the "Add File Type" dialog box, and click the "OK" button. The specified extension is added to "File types" on the "File Associations" page.
Select the added extension from "File types" on the "File Associations" page, and click the "Add..." button to the right of "Associated editors". The "Editor Selection" dialog box appears.
Confirm that Internal Editors is selected in the "Editor Selection" dialog box, and select "COBOL Editor".
"COBOL Editor" is added to "Associated editors" on the "File Associations" page.