Rational Developer for System z
COBOL for Windows, Version 7.5, Language Reference


RETURN-CODE

The RETURN-CODE special register can be used to pass a return code to the calling program or operating system when the current COBOL program ends. When a COBOL program ends:

The RETURN-CODE special register has the implicit definition:

01  RETURN-CODE GLOBAL PICTURE S9(4) USAGE BINARY VALUE ZERO.

When used in nested programs, this special register is implicitly defined with the GLOBAL clause in the outermost program.

The following are examples of how to set the RETURN-CODE special register:

The RETURN-CODE special register does not return a value from an invoked method or from a program that uses CALL ... RETURNING. For more information, see INVOKE statement or CALL statement.

You can specify the RETURN-CODE special register in a function wherever an integer argument is allowed.

The RETURN-CODE special register does not return information from a date/time callable service. For more information, see the COBOL for Windows Programming Guide.


Terms of use | Feedback

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