+-------------------------------IBM Extension--------------------------------+

LOC(X)

Purpose

Returns the address of X that can then be used to define an integer POINTER.

Class

Inquiry function

Argument Type and Attributes

X
is the data object whose address you want to find. It must not be an undefined or disassociated pointer or a parameter. If it is a zero-sized array, it must be storage associated with a non-zero-sized storage sequence. If it is an array section, the storage of the array section must be contiguous.

Result Type and Attributes

The result is of type INTEGER(4) in 32-bit mode and of type INTEGER(8) in 64-bit mode.

Result Value

The result is the address of the data object, or, if X is a pointer, the address of the associated target. The result is undefined if the argument is not valid.

Examples

INTEGER A,B
POINTER (P,I)
 
P=LOC(A)
P=LOC(B)
END

+----------------------------End of IBM Extension----------------------------+

IBM Copyright 2003