To assign initial values to program variables.
INITIALIZE [DATA] (Reference [,Reference]...);
The reference may be a field reference or a generic reference.
You use INITIALIZE to set, or reset, fields to their default values. For example: -
This sets every field in CustF to the value given in its VALUE clause. If there is no value clause then numeric fields are set to zero, string fields to blank, etc. See below for a list by type of default values. Also, for TYPE(SQL) fields all fields will be set to NULL unless they are defined NOTNULL.
If there is a VALUE clause, then the field’s value will be set to this.
ElseIf there is no VALUE clause, but there is a VALIDVALUES clause, then the field will be set to the first value in the list
Else field values will be set as following: -
Numeric fields: BIGINT, INTEGER, SMALLINT, DECIMAL, MONEY, FLOAT, LONG, PIC ‘picture specification’
String Fields: CHAR, VARCHAR.
Spaces. Also, the length of Varchar variables is set to Zero
B‘0’ (or X’0’ if appropriate)
DATETIME – combines DATE and TIME initialisation
Groups are initialised by initialising all their elements, not by simply assigning Spaces or X’0’ to the whole group.