The VALUE type function initializes or assigns to a variable that has the corresponding structure type.
|
If the VALUE function is used with a structure type that is partially initialized, uninitialized bytes and bits are set to zero.
The VALUE function cannot be used with a structure type containing no elements with the INITIAL attribute.
You can use the VALUE function with the INIT form of the INITIAL attribute on the elements of a DEFINE STRUCTURE statement. However, you cannot use INIT CALL and INIT TO with the VALUE function on the elements of a DEFINE STRUCTURE statement.
The following example shows how to use the VALUE function:
define struct
1 b,
2 b1 fixed bin init(17),
2 b2 fixed bin init(19);
define struct
1 c,
2 c1 type b init( value(: b :) ),
2 c2 fixed bin init(23);
dcl x type c static init( value(: c :) );
dcl y type c;
y = value(: c :);