I/O error values

The following table describes the EGL error values for input/output (I/O) operations that affect databases, files and WebSphere® MQ message queues. If you use V6 exception compatibility (see Using V6 exception compatibility), you have access to both hard and soft I/O errors (see is/not operator). For more information, see 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. If you are accessing an SQL table in DB2®, deadlock indicates that the value of sqlcode is -911.
duplicate Soft DL/I, Indexed, or Relative For more information, see "duplicate" in this topic.
endOfFile Soft DL/I, Indexed, Relative, Serial For more information, see "endOfFile" in this topic.
ioError Hard or Soft Any For more information, see "ioError" in this topic.
fileNotAvailable Hard Indexed, Relative, Serial fileNotAvailable is possible for any I/O operation and can 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 fileNotFound is possible for any I/O operation and indicates that a requested file was not found.
full Hard Indexed, Relative, Serial full is set in these cases:
  • An indexed or serial file is full
  • An indexed or relative file is implemented as a CICS® temporary storage queue, and an add tries to insert a key greater than 32767 bytes
hardIOError Hard Any For more information, see "hardIOError" in this topic.
invalidFormat Hard Indexed, Relative, Serial The accessed file is incompatible with the record definition. For more information, see "invalidFormat" in this topic.
noRecordFound Soft Any For more information, see "noRecordFound" in this topic.
softIOError Soft Any A soft error occurred, which is endOfFile, noRecordFound, or duplicate.
unique Hard DL/I, Indexed, Relative, SQL Your code tried to add or replace a record having a key that already exists, and the attempt failed. For more information, see "unique" in this topic.

duplicate

For an indexed or relative record, duplicate is set in these cases:
  • An add statement tries to insert a record whose key 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, 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.

If you are accessing an emulated VSAM file from an EGL-generated COBOL program on iSeries®, see "Association elements" in the EGL Generation Guide for a description of the duplicates property in the resource associations part that is used at generation time.

For a DL/I database, duplicate is a soft error, set when an add statement tries to insert a segment into a database in which records with duplicate keys are not permitted and a record with the same key already exists in the database. The add failed. The corresponding status code is II. The duplicate and unique values are equivalent for DL/I.

endOfFile

For a serial or relative record, endOfFile is set in these cases:
  • 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.
  • For a serial record implemented as a GSAM file, your code issues a get next statement and no more segments exist in the database. The corresponding status code is GB
  • For a serial record implemented as an IMS™ message queue, your code issues a get next statement no more messages exist on the message queue. The corresponding status code is QC.
For a serial or relative record, endOfFile is set in these cases:
  • Your code issues a get next statement 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 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. (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.
  • In relation to COBOL generation, a get previous statement attempts to retrieve data from an uninitialized file.

For a DL/I database, endOfFile is set when a get next or get next inParent statement attempts to retrieve data and the related database pointer is at the end of the database. The corresponding status code is GB.

ioError

This value is set by the following conditions:
  • For a serial, indexed, or relative file, a nonzero return code was received from the I/O operation.
  • For a serial file implemented as a GSAM file, DL/I returned any nonblank status code.
  • For a serial file implemented as an IMS message queue, DL/I returned any nonblank status code.
  • For a DL/I database, DL/I returned any nonzero CICS DL/I error code, or any nonblank DL/I status code.
  • When using DB2 for an SQL row record, the SQLCODE was anything other than 0.

hardIOError

A hard I/O error results from any failed I/O operation. The endOfFile and noRecordFound values are never considered hard errors. To test for hard I/O errors, you must be in V6 exception mode.
  • For other than DL/I operations, the system variable vgVar.handleHardIOErrors must be set to 1.
  • For DL/I I/O operations, one of the following conditions must be true:
    • vgVar.handleHardIOErrors is set to 1.
    • dliVar.handleHardDLIErrors is set to 1.
hardIOError is set in the following conditions:
  • For a serial, indexed, or relative file, any file I/O error occurred other than an error defined as a soft error. Soft errors set duplicate, endOfFile, noRecordFound, or unique.
  • For a serial file implemented as a GSAM file, DL/I returned any nonblank status code other than GB.
  • For a serial file implemented as an IMS message queue, DL/I returned any nonblank status code other than QC, QD, CE, CF, CG, CI, CJ, CK, or CL.
  • For a DL/I database, DL/I returned any nonzero CICS DL/I error code, or any nonblank DL/I status code other than GA, GB, GD, GE, GK, or II.
  • When using DB2 for an SQL row record, the SQLCODE is 304, 802, or less than 0.

invalidFormat

invalidFormat can result from any kind of I/O operation and might 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. Alternatively, on CICS, a get next or get previous statement attempts to retrieve data from an empty VSAM file into an indexed record.
  • 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.
  • For a DL/I database, no record is found in the database that satisfies the selection conditions specified in the DL/I call. This state can be set for an EGL add statement if the parent of a segment to be inserted is not found. The status code is GE.

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.

For a DL/I database, unique is set when an add statement tries to insert a segment into a database in which records with duplicate keys are not permitted and a record with the same key already exists in the database. The add failed. The corresponding status code is II. The duplicate and unique values are equivalent for DL/I.


Feedback