In the variable-definition option used with
DEFINE DATA LOCAL
,
DEFINE DATA
INDEPENDENT
, DEFINE
DATA CONTEXT
and DEFINE DATA OBJECT
, you may
specify either a scalar-definition or an
array-definition:
variable-name | (format-length) | init-definition | [emhdpm] | |||||||||||
DYNAMIC |
variable-name | (format-length/ array-definition) | array-init-definition | [emhdpm] | ||||||||||||
/array-definition | DYNAMIC |
This document covers the following topics:
For an explanation of the symbols used in the syntax diagram, see Syntax Symbols.
A variable-definition is used to define a single field/variable that may be single-valued (scalar) or multi-valued (array).
variable-name |
The name to be assigned to the variable. Rules for Natural variable
names apply. With For information on naming conventions for user-defined variables, see Naming Conventions for User-Defined Variables in the Using Natural documentation. |
---|---|
format-length | The format and length of the field. For information on format/length definition of user-defined variables, see Format and Length of User-Defined Variables in the Programming Guide. |
A, U or B | Data type: alphanumeric (A), Unicode (U) or binary (B) for dynamic variables. |
array-definition | With an array-definition, you define the lower and upper bounds of dimensions in an array-definition. See Array Dimension Definition. |
DYNAMIC | A field may be defined as DYNAMIC . For more
information on processing dynamic variables, see
Using Dynamic and Large
Variables.
|
CONSTANT |
The variable/array is to be treated as a named constant. The constant value(s) assigned will be used each time the variable/array is referenced. The value(s) assigned cannot be modified during program execution. See also Defining Fields, User-Defined Constants, Defining Named Constants in the Programming Guide. Note: |
INIT |
The variable/array is to be assigned an initial value. This value
will also be used when this variable/array is referenced in a
If no See also Defining Fields, Initial Values in the Programming Guide. Note: |
init-definition | With the init-definition option, you define the initial/constant values for a variable. See Initial-Value Definition. |
array-init-definition | With an array-init-definition, you define the initial/constant values for an array. See Initial/Constant Values for an Array. |
emhdpm | With this option, additional parameters to be in effect for a field/variable may be defined. See EM, HD, PM Parameters for Field/Variable. |
Format | Default Initial Value |
---|---|
B, F, I, N, P | 0 |
A, U | (blank) |
L | FALSE |
D | D' ' |
T | T'00:00:00' |
C | (AD =D )
|
Object Handle | NULL-HANDLE |
Fields declared as DYNAMIC
do not have any initial value
because their field length is zero by default.