PROCEDURE-POINTER phrase

The PROCEDURE-POINTER phrase defines an item as a procedure-pointer data item. A procedure-pointer data item can contain the address of a descriptor for a procedure entry point.

A procedure-pointer data item is an 8-byte elementary item regardless of the LP compiler option setting.

A procedure-pointer can point to a function descriptor for one of the following or can contain NULL:

  • The primary entry point of a COBOL program as defined by the program-ID paragraph of the outermost program of a compilation unit
  • An alternate entry point of a COBOL program as defined by a COBOL ENTRY statement
  • An entry point in a non-COBOL program

A procedure-pointer data item can be used only:

  • In a SET statement (format 6 only)
  • In a CALL statement (from a high-level language or LE-conforming assembler program)
  • In a relation condition
  • In the USING phrase of an ENTRY statement or the PROCEDURE DIVISION header

Procedure-pointer data items can be compared for equality or moved to other procedure-pointer data items.

Procedure-pointer data items can be part of a group that is referred to in a MOVE statement or an input/output statement. However, there is no conversion of values when the statement is executed. If a procedure-pointer data item is written to a data set, subsequent reading of the record that contains the procedure-pointer can result in an invalid value in the procedure-pointer.

A procedure-pointer data item can be the subject or object of a REDEFINES clause.

SYNCHRONIZED can be used with USAGE IS PROCEDURE-POINTER to obtain efficient alignment of the procedure-pointer data item.

The GLOBAL, EXTERNAL, OCCURS, and VOLATILE clauses can be used with USAGE IS PROCEDURE-POINTER.

A VALUE clause for a procedure-pointer data item can contain only NULL or NULLS.

The JUSTIFIED, PICTURE, and BLANK WHEN ZERO clauses cannot be used to describe group or elementary items defined with the USAGE IS PROCEDURE-POINTER clause.

A procedure-pointer data item cannot be a conditional variable.

A procedure-pointer data item does not belong to any class or category.

Procedure-pointer data items are ignored in CORRESPONDING operations.