VALUE

The VALUE type function initializes or assigns to a variable that has the corresponding structure type.

Read syntax diagramSkip visual syntax diagramVALUE(: t:)
t
Name of a typed structure. The VALUE function returns an instance of the typed structure t with its initial values.

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 :);