CALL POKE Routine

Writes a value directly into memory on a 32-bit platform.

Category: Special
Restriction: Use on 32-bit platforms only.

Syntax

Required Arguments

source

specifies a constant, variable, or expression that contains a value to write into memory.

pointer

specifies a numeric expression that contains the virtual address of the data that the CALL POKE routine alters.

Optional Arguments

length

specifies a numeric constant, variable, or expression that contains the number of bytes to write from the source to the address that is indicated by pointer. If you omit length, the action that the CALL POKE routine takes depends on whether source is a character value or a numeric value:

  • If source is a character value, the CALL POKE routine copies the entire value of source to the specified memory location.
  • If source is a numeric value, the CALL POKE routine converts source into a long integer and writes into memory the number of bytes that constitute a pointer.
    z/OS Specifics: Under z/OS, pointers are 3 or 4 bytes long, depending on the situation.

floating-point

specifies that the value of source is stored as a floating-point number. The value of floating-point can be any number.

Tip If you do not use the floating-point argument, then source is stored as an integer value.

Details

CAUTION:
The CALL POKE routine is intended only for experienced programmers in specific cases.
If you plan to use this routine, use extreme care both in your programming and in your typing. Writing directly into memory can cause devastating problems. This routine bypasses the normal safeguards that prevent you from destroying a vital element in your SAS session or in another piece of software that is active at the time.
If you do not have access to the memory location that you specify, the CALL POKE routine returns an "Invalid argument" error.
You cannot use the CALL POKE routine 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 CALL POKE, change the applications and use CALL POKELONG instead. You can use CALL POKELONG on both 32–bit and 64–bit platforms.
If you use the fourth argument, then a floating-point number is assumed to be the value that is stored. If you do not use the fourth argument, then an integer value is assumed to be stored.