The sysVar.returnCode system variable contains an external return code, as set by your program. A main program uses sysVar.returnCode to pass a return code to the operating system-which might mean JCL, CL, a batch file, or a command processor. A called program uses sysVar.returnCode to pass a return code to a non-EGL program.
It is not possible to pass return codes from one EGL program to another. For example, a non-zero value in sysVar.returnCode does not cause EGL to run an onException block.
The initial value of sysVar.returnCode is zero. For COBOL output, the value must be in the range of 0 to 512, inclusive.
The following example sets a return code to pass to the operating system.
sysVar.returnCode = 6;
Platform | Issue |
---|---|
Java™ generation |
|
COBOL generation |
|
CICS® for z/OS® | sysVar.returnCode is available after the program ends only if the program is called from another program in the same CICS region and is not invoked by an EXEC CICS LINK command. The return code is meaningful only if the CICS-based program is called (and only if the program is called from a non-EGL-generated program). |
IMS/VS | sysVar.returnCode is not passed back from main programs. |