Using multiple local preprocessors

You can process your source files with multiple local, site-developed preprocessors.

Before you begin

You must define a property group on a local or remote system.

About this task

Multiple local preprocessor support is available for the following compilation or syntax check operations:
  • Local syntax check of a local file.
    Attention: Local syntax check is deprecated.
  • Build of a local project.
  • Show Dependencies on a local project or local file.
    Note: Only files that were not created by a preprocess step can be considered dependencies. If a preprocess step creates several include files that are eventually passed to another preprocessor or the compiler, those generated include files are not considered dependencies.
  • Local syntax check of a remote file.

Information specific to LinuxInformation specific to LinuxIBM® Developer for z/OS® does not support the following functions on Linux® and macOS: bidirectional enablement with remote debugging, workstation-based debugging, local COBOL or PL/I builds, local preprocessors for PL/I files, local syntax check of PL/I files, or show dependencies for PL/I files.

You can specify up to 10 local preprocessors for a single build operation.

Procedure

To define and enable multiple local preprocessors:

  1. Open a property group in the property group editor.
  2. Open the Local Preprocessors page of the Local COBOL Settings or Local PLI Settings.
    The Local Preprocessors page contains two sections: the Preprocessors section shows all preprocessors in the property group. There are two ways to work with this list:
    • Select the check box next to a preprocessor name to enable the preprocessor to execute before a compilation or syntax check operation. This action is called selecting a preprocessor. The preprocessor is activated for execution only when the check box is selected.
    • Select the preprocessor name in the list to display the options that are set for it in the Preprocessor Options section. This action is called highlighting a preprocessor.
    The Preprocessor Options section shows the options for the selected preprocessor. On this page, you can do the following tasks:
  3. Click Finish to save the changes you made.

Example

The source program mysource.cob has different synonyms for COPY. The programmer writes a preprocessor, named preproc1.exe that processes –GET statements in the source. The output of that preprocessor is an XML file named mysource_PP1.xml and a DECK file named mysource_PP1.dek that is passed on to the next step.

The output file mysource_PP1.dek contains –INC statements that also must be processed. The programmer chooses to use the –INC preprocessor for the second preprocessor step. The output of that step is an XML file named mysource_PP2.xml and a DECK file named mysource_PP2.dek that is passed on to the compiler.

The compiler receives mysource_PP2.dek from the second preprocessor step. By now, the –GET statements and the –INC statements are removed from the source, and the DECK file that is being processed contains only valid COBOL statements.

To set up the preprocessor steps in a property group for this scenario, the programmer adds two preprocessor definitions, in the following order, to the property group for compiling the source:
  1. Remove -GET
    The Remove -GET preprocessor has the following preprocessor options specified:
    • Preprocessor Description: Remove -GET
    • Preprocessor Name (fully qualified): C:\mypreprocs\preproc1.exe
    • Preprocessor Output File Name: ${resource_fn}_PP1.dek
    • Support Error Feedback: The check box is selected.
    • Error Feedback XML file Name: ${resource_fn}_PP1.xml
  2. Remove -INC
    The Remove -INC preprocessor has the following preprocessor options specified:
    • Preprocessor Description: Remove -INC
    • Preprocessor Name (fully qualified): “${bundle:com.ibm.systemz.preprocessor.include}/bin/operatingSystem/PPINCL01
    • Preprocessor Output File Name: ${resource_fn}_PP2.dek
    • Support Error Feedback: The check box is selected.
    • Error Feedback XML file Name: ${resource_fn}_PP2.xml