Using procedure and function pointers

Procedure pointers are data items defined with the USAGE IS PROCEDURE-POINTER clause. Function pointers are data items defined with the USAGE IS FUNCTION-POINTER clause.

In this information, "pointer" refers to either a procedure-pointer data item or a function-pointer data item. You can set either of these data items to contain entry addresses of, or pointers to, the following entry points:

You can set a pointer data item only by using the SET statement. For example:

CALL 'MyCFunc' RETURNING ptr.
SET  proc-ptr  TO ptr.
CALL proc-ptr  USING dataname.

Suppose that you set a pointer item to an entry address in a load module that is called by a CALL identifier statement, and your program later cancels that called module. The pointer item becomes undefined, and reference to it thereafter is not reliable.

related references    
ADDR  
Migration of 32-bit applications to 64-bit mode
      
PROCEDURE-POINTER phrase (COBOL for AIX Language Reference)  
SET statement (COBOL for AIX Language Reference)