The EGL exit statement leaves the specified block, which by default is the block that immediately contains the exit statement.
An error occurs if the exit statement is not inside a case statement that begins in the same function.
An error occurs if the exit statement is not inside an if statement that begins in the same function.
The value in the system variable sysVar.returnCode is returned to the operating system in any of the following cases:
If the program ends with a terminating exit statement that includes a return code other than sysVar.returnCode, the specified value is used in place of any value that may be in sysVar.returnCode.
For details on return codes, see sysVar.returnCode.
For details, see sysVar.returnCode.
If you do not specify a label (as described later), processing continues at the statement after the most recently run function invocation in the main function. If you specify a label, processing continues at the statement that follows the label in the main function. The label may be before or after the most recently run function invocation in the main function.
If you specify an exit statement of the form exit stack in the main function, the next statement is processed, even if you specify a label. For details on how to go to a specified label in the current function, see goTo.
When displayed at the location where processing continues, the label is followed by colon. For details on valid characters for the label, see Naming conventions.
Related reference
goTo
Naming conventions
sysVar.returnCode
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.