Menu

#80 use of RETURNING in CALL

open
nobody
None
5
2010-05-27
2010-05-27
JimN
No

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.

Discussion

  • VenkatK

    VenkatK - 2010-05-30

    In the CALLed program how do you RETURN a value?

    -Venkat Krishnamurthy

     
  • JimN

    JimN - 2010-05-30

    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.

     
  • Anonymous

    Anonymous - 2010-10-29

    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.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.