X 6.2.22.6 RETURNING Phrase
X You can specify the RETURNING phrase for invoking methods written in
X COBOL, C, or in other programming languages that use C linkage
X conventions.
-
X identifier-6
-
X The RETURNING data item. Identifier-6:
- X Must be defined in the DATA DIVISION
- X Must not be reference-modified
- X Is not changed if an EXCEPTION occurs
- X Contains the return value of the invoked method
X If identifier-6 is specified and the target method is written in
X COBOL, then the target method must have a RETURNING phrase on its
X Procedure Division statement. When the target returns, its return
X value is assigned to identifier-6, using the rules for the SET
X statement if identifier-6 is USAGE IS INDEX, USAGE IS POINTER, USAGE
X IS PROCEDURE-POINTER, or USAGE IS OBJECT REFERENCE; otherwise, the
X rules for the MOVE statement are used.
X Note: The INVOKE... RETURNING data item is an output-only parameter. On
X entry to the called method, the initial state of the PROCEDURE DIVISION
X RETURNING data item has an undefined and unpredictable value. You must
X initialize the PROCEDURE DIVISION RETURNING data item in the invoked
X method before you reference its value. The value that is passed back to
X the invoker is the final value of the PROCEDURE DIVISION RETURNING data
X item when the invoked method returns.
X The RETURN-CODE special register is not set by execution of INVOKE
X statements.
X Conformance Requirements for RETURNING Phrase: The identifiers specified
X on an INVOKE RETURNING phrase and the corresponding method Procedure
X Division RETURNING phrase must satisfy the following:
- X The presence or absence of the RETURNING phrase must be consistent on
X the INVOKE statement and the Procedure Division header of the target
X method.
- X If one of the identifiers is a COBOL elementary data item not
X described with USAGE IS OBJECT REFERENCE, then the corresponding
X identifier must have the same PICTURE, USAGE, SIGN, SYNCHRONIZED,
X JUSTIFIED, and BLANK WHEN ZERO clauses. Note that periods and commas
X can be interchanged if specifying the DECIMAL POINT IS COMMA clause,
X and PICTURE clause currency symbols can differ.
- X If the INVOKE RETURNING identifier is a universal object reference,
X then the method Procedure Division RETURNING identifier must be an
X object reference (either a universal object reference or an object
X reference typed to a specific class).
- X If the INVOKE RETURNING identifier is an object reference typed to a
X specific class, then the method Procedure Division RETURNING
X identifier must be an object reference typed to the same class or a
X derived class.
© 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.