The following pointer operations can be used:
Ptr1 = Ptr1 - 16; Ptr2 = Ptr1 + (I*J);You can also use the built-in function, POINTERADD, to perform these operations. You must use POINTERADD if the result is used as a locator reference, for example:
(Ptr1 + 16) -> Based_ptr is invalid pointeradd(Ptr1,16) -> Based_ptr is valid
Bin31 = Ptr2 - Ptr1;
if Ptr2 > Ptr1 then
Bin31 = Ptr2 - Ptr1;Bin31 = Bin31 + binaryvalue(Ptr1);
dcl 1 Cvtprt pointer based(pointervalue(16));
dcl 1 Cvt based(Cvtptr),
2 Cvt ...;
If necessary, the expressions are converted to FIXED BINARY(31,0).A PL/I block can use pointer arithmetic to access any element within a structure or an array variable. However, the block must be passed the containing structure or array variable, or have the referenced aggregate within its name scope.