Rational Developer for System z
COBOL for Windows, Version 7.5, Programming Guide


RETURNING phrase for obtaining a returned value

If a data item is to be returned as the method result, specify the item in the RETURNING phrase of the INVOKE statement. Define the returned item in the DATA DIVISION of the client.

The item that you specify in the RETURNING phrase of the INVOKE statement must conform to the type returned by the target method, as shown in the table below.

Table 54. Conformance of the returned data item in a COBOL client
Programming language of the target method Is the returned item an object reference? Then code the DATA DIVISION definition of the returned item as:
COBOL No The same as the definition of the RETURNING item in the target method
Java No Interoperable with the returned Java data item
COBOL or Java Yes An object reference that is typed to the same class as the object reference that is returned by the target method

In all cases, the data type of the returned value must be one of the types that are interoperable with Java.

related tasks
Coding interoperable data types in COBOL and Java

related references
INVOKE statement (COBOL for Windows Language Reference)


Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)