PEEKCLONG Function

Stores the contents of a memory address in a character variable on 32-bit and 64-bit platforms.

Category: Special
See: PEEKCLONG Function: z/OS in SAS Companion for z/OS

Syntax

PEEKCLONG(address<,length> )

Required Argument

address

specifies a character constant, variable, or expression that contains the binary pointer address.

Optional Argument

length

is a numeric constant, variable, or expression that specifies the length of the character data.

Default 8
Range 1 to 32,767

Details

If you do not have access to the memory storage location that you are requesting, the PEEKCLONG function returns an “Invalid argument” error.

Comparisons

The PEEKCLONG function stores the contents of a memory address in a character variable.
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.

Examples

Example 1: Example for a 32-bit Platform

The following example returns the pointer address for the character variable Z.
data _null_;
   x='ABCDE';
   y=addrlong(x);
   z=peekclong(y,2);
   put z=;
run;
The output from the SAS log is: z=AB

Example 2: Example for a 64-bit Platform

The following example, specific to the z/OS operating environment, returns the pointer address for the character variable Y.
data _null_;
   length y $4;
   x220addr=put(220x,pib4.);
   ascb=peeklong(x220addr);
   ascbaddr=put(ascb,pib4.);
   y=peekclong(ascbaddr);
run;
The output from the SAS log is: y='ASCB'

See Also

Functions: