COMPOPT

#### Search Results

Search

# COMPOPT

`COMPOPT` [option=value ...]

This system command is used to set various compilation options. The options are evaluated when a Natural object is compiled.

If you enter the `COMPOPT` command without any options, a screen is displayed where you can enable or disable the options described below.

The default settings of the individual options are set with the corresponding profile parameters in the Natural parameter file.

This document covers the following topics:

- COMPOPT Syntax Explanation

- Compiler Options

- Specifying Compiler Parameters

## COMPOPT Syntax Explanation

`COMPOPT` | If you issue the `COMPOPT` system command without options, the Compilations Options screen appears. The keywords available there are described below.
`COMPOPT option=value` | Instead of changing an option on the screen, you can also specify it directly with the `COMPOPT` command. Example:
    COMPOPT DBSHORT=ON

## Compiler Options

The following compiler options are available. For details on the purpose of these options and the possible settings, see the description of the corresponding Natural profile parameter:

`DBSHORT` | `ECHECK` | `GFID` | `KCHECK` | `MASKCME` | `MAXPREC` | `PCHECK` | `PSIGNF` | `THSEP` | `TQMARK`

## Specifying Compiler Parameters

You can specify compiler parameters on different levels:

1. #### As Default Settings

   The default settings of the individual compiler parameters are specified using the Compiler Options category of the Configuration Utility and are stored in the Natural parameter file `NATPARM`.

2. #### At Session Start

   At session start, you can override the compiler option settings by specifying the corresponding profile parameters.

3. #### During an Active Natural Session

   During an active Natural session, there are two ways to change the compiler parameter values with the `COMPOPT` system command: either directly using command assignment (`COMPOPT option=value`) or by issuing the `COMPOPT` command without options which displays the Compilation Options screen. The settings assigned to a compiler option are in effect until you issue the next `LOGON` command to another library. At `LOGON` to a different libary, the default settings (see item 1 above) will be resumed. Example:

       OPTIONS KCHECK=ON
       DEFINE DATA LOCAL
       1 #A (A25) INIT <'Hello World'>
       END-DEFINE
       WRITE #A
       END

4. #### In a Natural Object

   In a Natural object (for example: program, subprogram), you can set compiler parameters with the `OPTIONS` statement. Example:

       OPTIONS KCHECK=ON
       WRITE 'Hello World'
       END

   The compiler options defined in an `OPTIONS` statement will only affect the compilation of this object, but do not update settings set with the command `COMPOPT`.

### On this page

- COMPOPT Syntax Explanation
- Compiler Options
- Specifying Compiler Parameters