X 1.1.3.5 RETURN-CODE
X The RETURN-CODE special register can be used to pass a return code to the
X calling program or operating system when the current COBOL program ends.
X When a COBOL program ends:
- X If control returns to the operating system, the value of the
X RETURN-CODE special register is passed to the operating system as a
X user return code. The supported user return code values are
X determined by the operating system, and might not include the full
X range of RETURN-CODE special register values. >_AIX_> For information
X on user return code values under AIX, see the IBM COBOL Set for AIX
X Programming Guide. <_AIX_<
- X If control returns to a calling program, the value of the RETURN-CODE
X special register is passed to the calling program. If the calling
X program is a COBOL program, the RETURN-CODE special register in the
X calling program is set to the value of the RETURN-CODE special
X register in the called program.
X The RETURN-CODE special register has the implicit definition:
X 01 RETURN-CODE GLOBAL PICTURE S9(4) USAGE BINARY VALUE ZERO
X The following are examples of how to set the RETURN-CODE special register:
X COMPUTE RETURN-CODE = 8
X or
X MOVE 8 to RETURN-CODE.
X When used in nested programs, this special register is implicitly defined
X in the outermost program.
X Note: The RETURN-CODE special register does not return a value from an
X invoked method or from a program that uses CALL...RETURNING. For more
X information, see "INVOKE Statement" in topic 6.2.22 or "CALL Statement" in
X topic 6.2.4.
X You can specify the RETURN-CODE special register in a function wherever an
X integer argument is allowed.
X The RETURN-CODE special register will not contain return code information:
- X On the host, from a service call for a Language Environment callable
X service. For more information, see the IBM COBOL for OS/390 & VM
X Programming Guide and Language Environment Programming Guide.
- X On the workstation, from a date/time callable service. For more
X information, see the IBM COBOL Programming Guide for your platform.
© 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.