General syntax of DEFINE DATA INDEPENDENT:
DEFINE DATA |
INDEPENDENT
[aiv-data-definition ...]
|
END-DEFINE |
This document covers the following topics:
For an explanation of the symbols used in the syntax diagrams, see Syntax Symbols.
The DEFINE DATA INDEPENDENT statement is used to define
application-independent variables (AIVs).
An application-independent variable is referenced by its name, and its content is shared
by all Natural objects executed within one application that refer to that name. The
variable is allocated by the first executed Natural object that references this variable
and is deallocated by the LOGON command or a RELEASE VARIABLES statement.
The optional INIT clause is
evaluated in each executed Natural object that contains this clause (not only in the
Natural object that allocates the variable).
Note
In an RPC server, application-independent variables (AIVs) are not deallocated
implicitly, but stay active across RPC requests, because different clients may have access
to the same variables on the RPC server. This means they must be deallocated explicitly
using the RELEASE VARIABLES
statement. See Application-Independent Variables in the
Natural RPC (Remote Procedure Call) documentation.
| Syntax Element | Description |
|---|---|
aiv-data-definition |
AIV Data Definition:
The |
END-DEFINE |
End of DEFINE DATA Statement:
The Natural reserved word |
| level |
|
variable-definition |
|
| redefinition |
Syntax Element Description:
| Syntax Element | Description |
|---|---|
level |
Level Number:
An application-independent variable must be defined at Level 01. Other levels are only used in a redefinition. |
variable-definition |
Variable Definition
A For further information, see Variable Definition. Note |
redefinition |
Redefinition:
With a For further information, see Redefinition. The subfields resulting from the redefinition must not be application-independent variables; that is, their name must not start with a plus sign (+). These fields are treated as local variables. |
Note
The first character of the name must be a plus (+). Rules for Natural variable names
apply, see Naming Conventions for User-Defined Variables in
Using Natural Studio.