What is Compiled and What is Not

#### Search Results

Search

# What is Compiled and What is Not

The Natural Optimizer Compiler is particularly effective for programs that contain a considerable amount of data manipulation, such as computation, transfer, and logical condition processing.

This section contains an overview of the statements which are compiled to machine code and those which are not compiled.

- Statements Compiled by the Natural Optimizer Compiler

- Statements that are Not Compiled

Note
The options the Natural Optimizer Compiler provides cannot be used for specifying statements to be optimized as described in the Optimizer Options.

## Statements Compiled by the Natural Optimizer Compiler

The Natural Optimizer Compiler compiles the following statements to machine code:

- #### Statements for Arithmetic and Data Movement Operations:

  - `ADD`

  - `ASSIGN`

  - `COMPRESS`

  - `COMPUTE`

  - `DIVIDE`

  - `EXAMINE`, with the following clauses:

    - `DIRECTION` (with constant values only; that is `FORWARD` or `BACKWARD`),

    - `GIVING NUMBER`, `GIVING POSITION` (also concurrently),

    - `GIVING LENGTH`

    - `EXAMINE .. FOR FULL <fld1> REPLACE FULL <fld2>` if the `EXAMINE` field is of type (Alpha/Binary) and the Search/Replace fields have the same length in the range (1:256)

    - `EXAMINE .. FOR <fld1> REPLACE <fld2>` if the EXAMINE field is of type (Alpha/Binary) and the Search/Replace fields are of type (A1) or (B1)

    - `TRANSLATE INTO (UPPER/LOWER) CASE`

    Example:

        EXAMINE #TEXT FOR #A GIVING NUMBER #NMB1
        EXAMINE #TEXT FOR #A GIVING POSITION #POSEX5
        EXAMINE #TEXT FOR #A GIVING LENGTH #LGHEX6

    Restrictions:

    - `GIVING INDEX` is not optimized.

    - `operand1` and `operand4` can be fix array occurences; that is, no ranges are admissible, for example:

          EXAMINE #A(#J) FOR #B(#K)

  - `MOVE` (`ROUNDED`, `SUBSTRING`, `BY NAME`, `LEFT`/`RIGHT JUSTIFIED`, )

  - `MOVE ALL`

  - `MULTIPLY`

  - `RESET`

  - `SUBTRACT`

- #### Statements for Processing of Logical Conditions:

  - `IF`

  - `DECIDE FOR`

  - `DECIDE ON`

- #### Statements for Loop Execution:

  `FOR`

- `ESCAPE`

- `REPEAT`

## Statements that are Not Compiled

The Natural Optimizer Compiler does not compile the following statements:

- I/O statements (`DISPLAY`, `WRITE`, `READ`/`WRITE WORK FILE`).

- complex special statements such as `SEPARATE`.

- statements that pass control to another object such as `FETCH`, `PERFORM`, `CALLNAT`, `CALL`.

- statements that perform database access (`READ`, `FIND`, `HISTOGRAM`, `GET`, `UPDATE`, `DELETE`, `END TRANSACTION`, `BACKOUT TRANSACTION`)

### On this page

- Statements Compiled by the Natural Optimizer Compiler
- Statements that are Not Compiled