ADDR Function


Returns the memory address of a numeric variable on a 32-bit platform

Category: Special

Restriction: Use on 32-bit platforms only.

Syntax

ADDR ( variable )

Arguments

variable

  • specifies a variable name .

Details

The value that is returned is always numeric. Because the storage location of a variable can vary from one execution to the next , the value that is returned by ADDR can vary. The ADDR function is used mostly in combination with the PEEK and PEEKC functions and the CALL POKE routine.

You cannot use the ADDR function on 64-bit platforms. If you attempt to use it, SAS writes a message to the log stating that this restriction applies. If you have legacy applications that use ADDR, change the applications and use ADDRLONG instead. You can use ADDRLONG on both 32-bit and 64-bit platforms.

Comparisons

The ADDR function returns the memory address of a numerical variable on a 32-bit platform. ADDRLONG returns the memory address of a character variable on 32-bit and 64-bit platforms.

Note: SAS recommends that you use ADDRLONG instead of ADDR because ADDRLONG can be used on both 32-bit and 64-bit platforms.

Examples

The following example returns the address at which the variable FIRST is stored:

 data numlist;     first=3;     x=addr(first);  run; 

See Also

CALL Routine:

  • 'CALL POKE Routine' on page 352

Functions:

  • 'PEEK Function' on page 708

  • 'PEEKC Function' on page 709

  • 'ADDRLONG Function' on page 296




SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 704

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net