I/O error values
The next table describes the EGL error values for input/output (I/O) operations that affect databases, files, and MQSeries message queues. The values associated with hard errors are available to your code only if the system variable sysVar.handleHardIOErrors is set to 1, as described in Exception handling.
Error value Type of error Type of Record Meaning of error value deadLock Hard SQL Two program instances are trying to change a record, but neither can do so without system intervention. duplicate Soft Indexed or Relative Your code tried to access a record having a key that already exists, and the attempt succeeded. For details, see duplicate. endOfFile Soft Indexed, Relative, Serial For details, see endOfFile. ioError Hard or Soft Any EGL received a non-zero return code from the I/O operation. format Hard Any The accessed file is incompatible with the record definition. For details, see format. fileNotAvailable Hard Any fileNotAvailable is possible for any I/O operation and could indicate, for example, that another program is using the file or that resources needed to access the file are scarce. fileNotFound Hard Indexed, Message queue, Relative, Serial A file was not found. full Hard Indexed, Relative, Serial full is set in these cases:
- An indexed or serial file is full
hardIOError Hard Any A hard error occurred, which is any error except endOfFile, noRecordFound, or duplicate. noRecordFound Soft Any For details, see noRecordFound. unique Hard Indexed, Relative, or SQL UNQ indicates unique: your code tried to add or replace a record having a key that already exists, and the attempt failed. For details, see unique. duplicate
For an indexed or relative record, duplicate is set in these cases:
- An add statement tries to insert a record whose key or record ID already exists in the file or in an alternate index, and the insertion succeeds.
- A replace statement overwrites a record successfully, and the replacement values include a key that is the same as the alternate-index key of another record.
- A get, get next, or get previous statement reads a record successfully (or a set statement of the form set record position runs successfully), and a second record has the same key.
The duplicate setting is returned only if the access method returns the information, as is true on some operating systems but not on others. The option is not available during SQL database access.
endOfFile
endOfFile is set in these conditions:
- Your code issues a get next statement for a serial or relative record when the related file pointer is at the end of the file. The pointer is at the end when the last record in the file was accessed by a previous get or get next statement.
- Your code issues a get next statement for an indexed record when the related file pointer is at the end of file, as occurs in these situations:
- The last record in the file was accessed by a previous get or get next statement; or
- The last record in the file was accessed by a previous set statement of type set record position when either of these conditions applies:
- The key value matched the key of the last record in the file; or
- Every byte in the key value was set to hexadecimal FF. (If a set statement of type set record position runs with a key value set to all hexadecimal FF, the statement sets the position pointer to the end of the file.)
- Your code issues a get previous statement for an indexed record when the related file pointer is at the beginning of file, as occurs in these situations:
- The first record in the file was accessed by a previous get or get previous statement;
- Your code did not previously access the same file; or
- A set statement of type set record position ran with a key when no keys in the file were previous to that key.
- A get next statement attempts to retrieve data from an empty or uninitialized file into an indexed record.
(An empty file is one from which all records have been deleted. An uninitialized file is one that has never had any records added to it.)
- A get previous statement attempts to retrieve data from an empty file into an indexed record.
format
format can result from any kind of I/O operation and could be set for these reasons, among others:
- Record format
The file format (fixed or variable length) is different from the EGL record format.
- Record length
In relation to fixed-length records, the length of a record in the file is different from the length of the EGL record. In relation to variable-length records, the length of a record in the file is larger than the length of the EGL record.
- File type
The file type specified for the record does not match the file type at run time.
- Key length
The key length in the file is different from the key length in the EGL indexed record.
- Key offset
The key position in the file is different from the key position in the EGL indexed record.
noRecordFound
noRecordFound is set in these conditions:
- For an indexed record, no record is found that matches the key specified in a get statement.
- For EGL-generated Java, your code issues a get next or get previous statement for an indexed record when the VSAM file is empty or uninitialized.
- For a relative record, no record is found that matches the record ID specified in a get statement. Alternatively, a get next statement tries to access a record that is beyond the end of the file.
- For a SQL record, no row is found that matches the specified SELECT statement; or a get next statement occurs when no selected rows are left to review.
unique
For an indexed or relative record, unique is set in these cases:
- An add statement tries to insert a record whose key or record ID already exists in the file or in an alternate index, and the insertion fails because of the duplication.
- A replace statement fails to overwrite a record because the replacement values include a key that is the same as the alternate-index key of another record.
The unique setting is returned only if the access method returns the information, as is true on some operating systems but not on others.
During SQL database access, unique is set when a SQL row being added or replaced has a key that already exists in a unique index. The corresponding sqlcode is -803.
Related reference
add
Association elements
close
delete
Exception handling
execute
get
get next
get previous
Logical expressions
open
prepare
replace