sysVar.errorCode
The system variable sysVar.errorCode receives a status code after any of the following events:
- The invocation of a call statement, if that statement is in a try block
- An I/O operation on an indexed, MQ, relative, or serial file
- The invocation of almost any system function in these cases--
- The invocation is within a try block; or
- The program is running in VisualAge Generator Compatibility mode and sysVar.handleSysLibErrors is set to 1
The sysVar.errorCode values associated with a given system function are described in relation to the system function, not in the current topic.
You can use sysVar.errorCode in these ways:
- As the source or target in an assignment or move statement
- As a variable in a logical expression
- As the argument in a system function
sysVar.errorCode is set to 0 if the call, I/O, or system function invocation is successful.
The characteristics of sysVar.errorCode are as follows:
- Primitive type
- CHAR
- Data length
- 8
- Is value always restored after a converse?
- Yes
For an overview that includes details on sysVar.errorCode, see Exception handling. The list of possible sysVar.errorCode values is provided in EGL Java run-time error codes.
Example
if (sysVar.errorCode = "00000008") exit program; end
Related reference
EGL Java run-time error codes
Exception handling
Exception handling and status (system words)
System words in alphabetical order
sysVar.handleSysLibErrors
try