use of RETURNING in CALL
Status: Alpha
Brought to you by:
mrvenkatkrish
I have found that the RETURNING verb is not allowed in the CALL statement
This one fails
CALL "getpid" RETURNING INTO GV-PID.
This one works.
CALL "getpid" USING BY REFERENCE GV-PID.
I assume this is MF Cobol extensions to the language, so if this is difficult, then dont bother changing it.
Thanks.
In the CALLed program how do you RETURN a value?
-Venkat Krishnamurthy
In this case, the called program is a C program that is part of the Unix OS and it returns an integer value for the Process ID of the currently executing process.
In Microfocus Cobol, they have added additional parameter to the Go Back verb to allow for GIVING or RETURNING to be added, then either a variablename or value, or an "ADDRESS OF" a variable.
This is an extension implemented by many of the COBOLs (e.g., RM/COBOL, MF COBOL and isCOBOL).
It can also be used with CALLed COBOL programs by specifying:
PROCEDURE DIVISION USING ... RETURNING <data-item>
It is used extensively by applications that use those COBOL dialects that have it.