🛠️ P3/COBOL 25.1.0-SNAPSHOT is available for preview.
Getting Started
Configuration

Compiler & Runtime Options

There are many options controlling the behavior of the P3/COBOL compiler and compiled applications. They may be set either in one of the configuration files (commonly named compiler.p3c or runtime.p3c, but using the .p3c extension in any case) or on the (p3) command line used to start the P3/COBOL compiler or run the compiled program.

⚠️

When both a designated configuration file and the command line itself set a particular option, the command line option setting always overrides the same named option specified in the configuration file.

The recommended way is using the compiler.p3c and runtime.p3c files, to have all options in one place, like:

    • compiler.p3c
    • runtime.p3c
  • Many common options have both a "long name" and a single-character abbreviation (a "short name"). When a “short name” is given, the option may be set on the command line by preceding the short name with a single "-" and then providing the value associated with the option (if any) following a space character. For example,

    p3 b –I copy –c config/compiler.p3c my-program.cbl

    In the above, the -c defines the location of the compiler configuration file to be config/compiler.p3c relative to the working directory. The name of the program being compiled is my-program.cbl and is to be found in the current directory by that name.

    Similarly, the “long name” may always be used by preceding the option with --, for example:

    p3 b --copy-directories copy --config-file config/compiler.p3c my-program.cbl

    If the option takes a boolean value (true or false), the value is assumed to be true if only the long name (or short name if applicable) is present, for example: --list-output and set the list-output option to true.

    p3 b --list-output my-program.cbl

    A boolean valued option may be set to false by adding a "no-" prefix to the option name, for example: --no-list-output and --list-output false both set the list-output option to false.

    p3 b --no-list-output my-program.cbl

    In an option configuration file, only the long name (without a no- prefix) may be used, and it forms the element name of an XML element enclosing the value, as in:

    <copy-directories>copy ../common/copy</copy-directories>

    In the above, the --copy-directories option is set to a list of values comprising "copy" and "../common/copy".

    Some complex options contain attributes and elements within the option element itself. These options must be specified in a configuration file, and no corresponding command-line form is possible.

    For a complete description of the p3 build and p3 run options, see: