Rocket® Enterprise Developer (formerly a product of Micro Focus or formerly a product of Open Text) documentation, created before Rocket Software acquired certain products from OpenText, may include outdated references to "Micro Focus" or "OpenText", both of which are trademarks of OpenText or its affiliates. Rocket Software is not affiliated with Micro Focus or OpenText and has since rebranded these products as Rocket® products. You may also encounter outdated links in this documentation. If you do, please contact Rocket Support (support@rocketsoftware.com) for assistance.
ADDRDATA
Purpose
Returns a pointer to the storage referenced by the specified variable.
Syntax
ADDRDATA(x)
Parameters
x is a specified variable.
Description
The ADDRDATA function returns a pointer to the storage referenced by a specified variable x. Its behavior is similar to that of ADDR except when x is a reference to a varying string. In this case ADDRDATA returns the address of the first data byte of the string.
Examples
myprog: proc options (main);
dcl str char(12) var init ('abcdefgh');
dcl s char (4) based;
dcl i fixed bin (15) init (99);
dcl fb15 fixed bin (15) based;
dcl p ptr;
p = addrdata(str);
put skip list (addrdata(i)->fb15, addr(str)->fb15, p->s,
ptradd(addrdata(str),4)->s);
end;
Results in:
99 8 abcd efgh