EGL provides error-related system variables that are set in a try block either in response to successful events or in response to non-terminating errors. The values in those variables are available in the try block and in code that runs subsequent to the try block, and the values in most cases are restored after a converse, if any.
The EGL run time does not change the value of any error-related variables when statements run outside of a try block. Your program, however, may assign a value to an error-related variable outside of a try block.
The system variable sysVar.exceptionCode is given a value in various situations, and in all those situations one or more additional variables are also set, depending on the nature of the program's interaction with the run-time environment:
If a non-terminating error occurs in a try block, the value of sysVar.exceptionCode is equivalent to the numeric component of the EGL error message that would be presented to the user if the error occurred outside of the try block. The values of the situation-specific variables like sysVar.errorCode and sysVar.mqConditionCode, however, are provided by the run-time system. In the absence of an error, the value of sysVar.exceptionCode and at least one of the situation-specific variables is the same: a string of eight zeroes.
An error code is assigned to sysVar.exceptionCode and sysVar.errorCode in the case of a non-terminating numeric overflow, as described in sysVar.handleOverflow; but a successful arithmetic calculation does not affect any of the error-related system variables.
Error-related system variables are also not affected by the invocation of a function other than a system function, and sysVar.errorCode (the variable affected by most system functions) is not affected by errors in these:
When an error value is assigned to sysVar.exceptionCode, the system variable sysVar.exceptionMsg is assigned the text of the related EGL error message, and the system variable sysVar.exceptionMsgCount is assigned the number of bytes in the error message, excluding trailing blanks and nulls. When the string of eight zeroes is assigned to sysVar.exceptionCode, sysVar.exceptionMsg is assigned blanks and sysVar.exceptionMsgCount is set to zero.
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.