LOCVAL(x, a) returns the value at the offset that is specified by x in the a area. The type of the value is specified in the LOCATES attribute of x.
>>-LOCVAL-(x-+----+-)------------------------------------------>< '-,a-'
Do not use a LOCVAL reference as the argument to the ADDR built-in function. To obtain the address of such a reference, apply the POINTER built-in function to the corresponding OFFSET.
declare
1 data based(data_ptr) unaligned,
2 actual_count fixed bin(31),
2 orderinfo(order_count refer( actual_count)),
3 name offset(pool) locates(char(30) varying),
3 address offset(pool) locates(char(62) varying),
2 pool area(10_000);