Library View Topics Framed Contents Revised Topics Previous Topic Next Topic Search Search ResultsPrevious Topic MatchNext Topic Match Notes List Notes Print Download No PDF Handheld DisconnectedHandheld ConnectedHelp

X 6.2.22 INVOKE Statement




X The INVOKE statement invokes a method defined in a class or a metaclass.
X Methods can contain INVOKE statements, and a method can execute an INVOKE
X statement that directly or indirectly invokes itself. Therefore, all
X methods are implicitly recursive (unlike COBOL programs, which support
X recursion only if the RECURSIVE attribute is specified in the PROGRAM-ID
X paragraph.)


X The process for resolving the method name specified on the INVOKE
X statement to a method implementation is as specified by the IBM SOM. The
X method resolution is not case sensitive.


 X  ___ Format _____________________________________________________________________________ 
 X |                                                                                        |
 X | >>__INVOKE__ _identifier-1_______________ __ _literal-1____ _________________________> |
 X |             |_class-name-1_______________|  |_identifier-2_|                           |
 X |             |_SELF_______________________|                                             |
 X |             |_ _________________ __SUPER_|                                             |
 X |               |_class-name-2 OF_|                                                      |
   |                                                                                        |
 X | >__ ____________________________________________________________________________ ____> |
 X |    |        <_________________________________________________________________  |      |
 X |    |                                   <__________________________________    | |      |
 X |    |_USING____ _ ___________________ ____ _ ____________ __identifier-3_ _|_ _|_|      |
 X |               | |_ ____ __REFERENCE_|    | |_ADDRESS OF_|               |   |          |
 X |               |   |_BY_|                 |_OMITTED______________________|   |          |
 X |               |                  <__________________________________        |          |
 X |               |_ ____ __CONTENT____ _ ____________ __identifier-4_ _|_______|          |
 X |               | |_BY_|             | |_ADDRESS OF_|               |         |          |
 X |               |                    | |_LENGTH OF__|               |         |          |
 X |               |                    |_literal-2____________________|         |          |
 X |               |                    |_OMITTED______________________|         |          |
 X |               |                <__________________________________          |          |
 X |               |_ ____ __VALUE____ _ ____________ __identifier-5_ _|_________|          |
 X |                 |_BY_|           | |_ADDRESS OF_|               |                      |
 X |                                  | |_LENGTH OF__|               |                      |
 X |                                  |_literal-3____________________|                      |
   |                                                                                        |
 X | >__ ___________________________ __ _____________________________________________ ____> |
 X |    |__RETURNING__identifier-6__|  |__ ____ __EXCEPTION__imperative-statement-1__|      |
 X |                                      |_ON_|                                            |
   |                                                                                        |
 X | >__ __________________________________________________ __ ____________ _____________>< |
 X |    |__NOT__ ____ __EXCEPTION__imperative-statement-2__|  |_END-INVOKE_|                |
 X |            |_ON_|                                                                      |
   |                                                                                        |
   |________________________________________________________________________________________|

X identifier-1

X Must be defined as USAGE OBJECT REFERENCE. The contents of
X identifier-1 specify the object on which a method is invoked.


X The results of the INVOKE statement are undefined if:


X class-name-1

X If class-name-1 is specified, the method is invoked on the class
X object of class-name-1.


X You must specify class-name-1 in the REPOSITORY paragraph of the
X Configuration Section of the class or program that contains the INVOKE
X statement.


X SELF

X An implicit reference to the object upon which the currently executing
X method was invoked. When SELF is specified, the INVOKE statement must
X appear within the Procedure Division of a method.


X SUPER

X A reference to the object that was used in the invocation of the
X currently executing method. The resolution of the method to be
X invoked will ignore any methods declared in the class definition of
X the currently executing method and methods defined in any class
X derived from that class, thus the method invoked will be one that is
X inherited from an ancestor class. To invoke a method that is
X inherited from a specific class, you can qualify SUPER with a class
X name (class-name-2).


X class-name-2

X The class to which the inherited method belongs.


X You must specify class-name-2 if the reference to SUPER is in a method
X definition of a class that uses multiple inheritance. Specify
X class-name-2 in the REPOSITORY paragraph of the Configuration Section
X of the class or program that contains the INVOKE statement.
X Class-name-2 must be a direct or indirect parent class.


X literal-1

X The name of the method to be invoked. The referenced object must
X support the method identified by literal-1.


X Literal-1 must be a nonnumeric literal.


X identifier-2

X A nonnumeric data item whose value is a method name. The referenced
X object must support the method identified by identifier-2.


X If identifier-2 is specified, identifier-1 must be defined as USAGE
X OBJECT REFERENCE without any optional phrases.


X Identifier-2 cannot be a windowed date field.

Subtopics:



Previous Topic Next Topic © Copyright IBM Corp. 1991, 1998

IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.





Return to library:   z/OS | z/OS.e | TPF | z/VSE | z/VM | IBM Hardware | IBM System z Redbooks
Glossary:   IBM terminology
Publications:   How to order publications
Readers:   Download IBM Library Reader | Download IBM Softcopy Reader | Download Adobe® Acrobat® Reader®
Library management:   Download IBM Softcopy Librarian
Contacts:   Contact z/OS


Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.