Inline method invocation

Inline method invocation references a temporary data item returned from invocation of a method.

General Format


Syntax for General Format for Inline method invocation

Syntax Rules

  1. Inline method invocation must not be specified as a receiving operand.
  2. Identifier-1 must be of class object; neither the predefined object reference NULL nor a universal object reference may be specified.
  3. One of the INVOKE statements specified in general rule 1 must be valid according to syntax rules for the INVOKE statement.
  4. The data item referenced in the RETURNING phrase of the invoked method's PROCEDURE DIVISION header must not be described with the ANY LENGTH clause.

General Rules

  1. An inline method invocation references a temporary data item with the same class, category, and content as the temp-identifier that would be returned from the execution of the applicable form of INVOKE statement, as follows:
    INVOKE identifier-1 literal-1 USING arguments RETURNING temp-identifier INVOKE identifier-1 literal-1 RETURNING temp-identifier INVOKE class-name-1 literal-1 USING arguments RETURNING temp-identifier INVOKE class-name-1 literal-1 RETURNING temp-identifier
    where:
    1. arguments are the operands specified within parentheses in the inline method invocation, if any
    2. temp-identifier has the same description, class, and category as the RETURNING parameter in the specification of the method identified by literal-1 and either identifier-1 or class-name-1
    3. temp-identifier is a temporary item that exists for the purpose of effecting the inline invocation in this way and for no other purpose