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