Stores the contents of a memory address in a numeric variable on 32-bit and 64-bit platforms
Category: Special
See: PEEKLONG Function in the documentation for your operating environment
PEEKLONG ( address <, length >)
address
specifies a character string that is the memory address.
length
specifies the length of the character data.
Default: 4 on 32-bit machines; 8 on 64-bit machines.
Range: 1-4 on 32-bit machines; 1-8 on 64-bit machines.
If you don't have access to the memory storage location that you are requesting, the PEEKLONG function returns an 'Invalid argument' error.
The PEEKLONG function stores the contents of a memory address in a numeric variable. It assumes that the input address refers to an integer in memory.
The PEEKCLONG function stores the contents of a memory address in a character variable. It assumes that the input address refers to character data.
The following example returns the pointer address for the numeric variable Z.
data _null_; length y ; y=put(1,IB4.); addry=addrlong(y); z=peeklong(addry,4); put z=; run;
The output from the SAS log is: z=1
The following example, specific to the z/OS operating environment, returns the pointer address for the numeric variable X.
data _null_; x=peeklong(put(16,pib4.)); put x=hex8.; run;
The output from the SAS log is: x=00FCFCB0
Function:
'PEEKCLONG Function' on page 712