Simple variables can be initialized when they are declared by assigning them an initial value by means of the INITIAL-VALUE operand.
If the variable is declared with a fixed data type, i.e. with INTEGER, BOOLEAN or STRING, the initial value must have this same data type; otherwise, an error will occur.
If the ANY data type is specified, the value that is specified for INITIAL-VALUE determines the variable’s current data type.
Unless otherwise specified, the variables are not assigned an initial value; the user must assign this value explicitly.
If the user explicitly assigns an initial value using INITIAL-VALUE, a distinction must be made as to whether a variable is being declared for the first time or an existing variable is being redeclared. Only variables that are being declared for the first time can be initialized. If an existing variable is redeclared, the old value is not overwritten and the new initial value entry is ignored.
Variables that are not initialized (i.e. do not contain a valid value) can be “write” accessed only. Write-accessing variables means that the variable names are assigned a value either explicitly or implicitly using the SET-VARIABLE or READ-VARIABLE command.
Attempts to read-access uninitialized variables result in an error. “Read-accessing variables” means that the contents of the variable are evaluated, e.g. by means of a function, in an expression, etc.
Constant (initial) value
The DECLARE-CONSTANT command declares a write-protected variable with a constant initial value.
The variable declaration must contain a value specification for the VALUE suboperand; the specified value cannot be overwritten by subsequent assignments. This means that it is neither possible to modify the value using SET-VARIABLE nor to delete the value using FREE-VARIABLE.