Functions and CALL Routines |
Stores the contents of a memory address in a character variable
on 32-bit and 64-bit platforms.
Category: |
Special
|
See: |
PEEKCLONG Function
under z/OS
|
PEEKCLONG(address<,length>)
|
-
address
-
specifies a character constant, variable,
or expression that contains the binary pointer address.
-
length
-
is a numeric constant, variable, or expression
that specifies the length of the character data.
Default: |
8 |
Range: |
1 to 32,767 |
If you do not have access to the memory
storage location that you are requesting, the PEEKCLONG function returns an "Invalid
argument" error.
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.
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
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'
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.