Natural Nucleus

#### Search Results

Search

# Natural Nucleus

The Natural nucleus consists of two functional parts: the environment-dependent nucleus and the environment-independent nucleus.

The environment-dependent nucleus contains components that depend on the mainframe operating system or TP system (online interface) in use.

The environment-independent nucleus can be shared by different mainframe operating and TP systems and used simultaneously by multiple users. The environment-independent nucleus comprises the kernel of Natural which supplies important Natural functions such as command interpretation, object compilation and object execution.

This section describes the main components of the environment-independent nucleus.

- Natural Runtime System

- Natural Compiler

- Natural Command Interpreter

- Configuration Settings

## Natural Runtime System

The Natural runtime system can be considered a virtual machine that provides the environment necessary for executing Natural objects within an application. The Natural runtime system interprets and executes Natural internal object code (binary meta code).

The section below contains information on:

- Object Execution

- Object Starter and Object Executor

### Object Execution

Internal Natural object code is executed when a Natural object is requested for execution.

Object execution is requested either directly by a user, or indirectly if the object currently being executed issues a Natural statement that requests execution of another object. The Natural system command `EXECUTE`, for example, directly executes the user-written program specified with the command. The Natural `CALLNAT` statement specified in a Natural program, for example, requests execution of a subprogram.

The Example of Object Loading in the section Natural Buffer Pool illustrates the process flow when executing a Natural program.

### Object Starter and Object Executor

The diagram below is a schematic illustration of object execution by the Natural runtime system:

The Natural runtime system consists of two major components: the object starter and the object executor.

The object starter locates the object to be executed in the Natural buffer pool and allocates storage for variable data processed by the object as user session data. Finally, the object starter passes control to the object executor.

The object executor interprets the Natural statements in the object and executes them one after the other. In the diagram above, for example, the object executor first processes the `READ` statement by calling the database and retrieving the records requested and then continues with the `MOVE` statement.

#### Related Topics:

- User Session Data

- Natural Buffer Pool

- Example of Object Loading - Natural Buffer Pool

## Natural Compiler

The Natural compiler generates the executable form of Natural source code. Natural source code is human-readable programming code that consists of a sequence of Natural statements. (For information on Natural statements and programming advice, see the Statements documentation and the Programming Guide.)

The Natural compiler reads the source code from the source area. The source code in the source area is part of the user session data. Source code is read into the source area by using the Natural system command `READ` or `EDIT`. The compiler checks the syntax of the source code and, if successful, generates Natural internal object code that can be interpreted and executed by the Natural runtime system.

When using the appropriate Natural system command, source code can be either compiled and executed, or compiled and stored. The section below describes the types of object module available for storage and the Natural system commands used for object compilation and execution:

- Cataloged Object

- Source Object

- Commands for Compilation

- Example of Compilation

### Cataloged Object

A cataloged object is the executable (compiled) form of a Natural object. It is created by the Natural compiler and is stored as an object module in a Natural system file. Compiling source code and creating a cataloged object is referred to as cataloging an object. A cataloged object is created by using the Natural system command `CATALOG` or `STOW`.

At execution time, the cataloged object is loaded into the Natural buffer pool and executed by the Natural runtime system. Natural objects can only be executed or reference one another if they have been stored as cataloged objects in a Natural system file.

A cataloged object cannot be modified or decompiled.

### Source Object

A source object (or a saved object) contains the human-readable form of Natural source code. Source code is saved as a source object in a Natural system file by using the Natural system command `SAVE` or `STOW`.

To execute source code contained in a source object, you need to compile the source code in order to create generated object code that can be interpreted and executed by the Natural runtime system.

### Commands for Compilation

Natural provides different system commands for compiling source code. Depending on the Natural system command used, compilation is combined with any of the following actions:

Action | System Command
--- | ---
Compile source code. Perform a syntax check and generate object code. The generated object code is not stored as an object module in a Natural system file. | `CHECK`
Compile source code. If successful, store the generated object code as a cataloged object in a Natural system file. | `CATALOG`
Compile source code. If successful, store the generated object code as a cataloged object in a Natural system file. Additionally, store the original source code as a separate source object in a Natural system file. | `STOW`
Compile source code of a Natural object of the type program. If successful, immediately execute the generated object code. The generated object code is not stored as an object module in a Natural system file. | `RUN`

#### Related Topics:

- System Commands documentation

- Objects for Natural Application Management - Programming Guide

### Example of Compilation

The diagram below illustrates the process flow when compiling source code with the Natural system command `CATALOG`:

Legend

| A user issues the Natural system command `CATALOG PGM01` requesting compilation of the source code currently contained in the source area and storage of the generated object code as a cataloged object with the name PGM01.
| The Natural command interpreter interprets the command `CATALOG` and passes on the request to the Natural compiler.
| The Natural compiler reads the Natural statements currently contained in the source area, checks the syntax and generates object code.
| The Natural compiler returns control to the Natural command interpreter.
| The Natural command interpreter stores the generated object code as a cataloged object with the name PGM01 in the current Natural system file.

## Natural Command Interpreter

The Natural command interpreter checks and executes user command input from a Natural command prompt.

If Natural Security is installed, command execution can be restricted to a single user or a group of users.

#### Related Topics:

- System Commands documentation

- Natural Security documentation

## Configuration Settings

Natural parameters manage the configuration of a Natural environment.

Natural parameters are used to standardize and automate development and production processes or adapt standard settings to the needs of individual users. A Natural parameter, for example, is used to set defaults for report creation, define the size of a report or define the size of storage area required such as the source area of an editor.

Most of the characteristics of a Natural environment are predefined by Software AG. The Natural administrator can configure different default environment settings valid for all Natural users. A user can adapt the settings to his needs by overriding default environment settings with a dynamic profile parameter or session parameter.

The section below contains information on:

- Profile Parameters

- Session Parameters

- Parameterization Levels

### Profile Parameters

Profile parameters are specified statically or dynamically.

Static parameters are specified in the Natural parameter module, during the installation of Natural. They are used as the default for each Natural session.

Dynamic parameters are specified at the start of a Natural session. You can predefine a set of dynamic parameters with the Natural SYSPARM utility.

#### Related Topics:

- Profile Parameters - Parameter Reference documentation

- Profile Parameter Usage - Operations documentation

- Building a Natural Parameter Module - Operations documentation

- SYSPARM Utility - Utilities documentation

### Session Parameters

Session parameters are specified within an active Natural session and/or within a Natural object. The main purpose of session parameters is to control the execution of Natural programs.

#### Related Topic:

- Session Parameters - Parameter Reference documentation

### Parameterization Levels

There is a hierarchical structure of the levels at which Natural parameters can be set. A parameter value set on a higher level overrides the value defined on a lower level. For example, when you specify a parameter dynamically, the new parameter value overrides the static specification as set for the corresponding parameter in the Natural parameter module.

The diagram below illustrates when a parameter can be set and the Natural parameter hierarchy from the lowest level at the base of the pyramid to the highest level at the apex:

#### Related Topic:

- Natural Parameter Hierarchy - Operations documentation

### On this page

- Natural Runtime System
- Natural Compiler
- Natural Command Interpreter
- Configuration Settings