Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Using program pointers

Program pointers can be used as follows:

  1. as the program to be called in the CALL statement

  2. as formal parameters in the PROCEDURE DIVISION USING phrase

  3. as current parameters in the CALL or INVOKE statement

  4. in the SET statement: to assign program pointers or program address identifiers

  5. in the INITIALIZE statement to occupy program pointer data items in advance

  6. in relation conditions: to carry out comparisons with the predefined address NULL, with a program address identifier and with other program pointers and ascertain whether they are the same or different

  7. in the LENGTH function: this function supplies the value 4 for FUNCTION LENGTH (program pointer). FUNCTION LENGTH (ADDRESS OF PROGRAM ...) is currently not supported.

Example 12-30

Calling a program using a program pointer:

01 pgmptr USAGE PROGRAM-POINTER.
SET pgmptr TO ADDRESS OF PROGRAM "UPROGP".
CALL pgmptr.

Example 12-31

Calling a subprogram using a program pointer as a parameter:

01 pgmptr USAGE PROGRAM-POINTER.
SET pgmptr TO ADDRESS OF PROGRAM "UPROGP".
CALL "UNDER" USING pgmptr.