Start of change

-452   UNABLE TO ACCESS THE FILE REFERENCED BY HOST VARIABLE variable-position. REASON CODE: reason-code

Explanation

An error was encountered while DB2® was accessing, or attempting to access, the file referenced by the specified host variable.
variable-position
Indicates the position of the host variable that referenced the file, as the nth host variable, where n is the value.
reason-code
A numeric value that indicates the reason for the error:
1
If the file name length is invalid, the path has an invalid format, or a relative path was specified.
2
If the file option is invalid (the file option must be 2, 8, 16, or 32), or the specified file option is not consistent with the operation that DB2 attempted to perform. For example, the file option FILE_READ is specified on a FETCH SQL statement.
3
If the file cannot be found.
4
If the SQL_FILE_CREATE option was specified for a file with the same name as an existing file.
7
If a full disk was encountered while writing to the file.
9
If a media error was encountered while accessing the file.
12
If the HFS file DB2 attempted to open for a read, append, or rewrite operation is not a regular file:
  • The BSAM data set that DB2 attempted to open for a read, append, or rewrite operation is not a physical sequential (PS) or partition organization (PO) data set.
  • The BSAM data set that DB2 attempted to open for a read, append, or rewrite operation does not have a record format of VB, V, or U.
  • The APPEND option was specified for a data set with partition organization (PO).
13
If errors were encountered when DB2 attempted to OPEN, READ, WRITE, or CLOSE an HFS file or BSAM data set, there might be a system completion code on the console to indicate the reason that DB2 was unable to perform the requested operation.

variable-position is set to 0 if the host variable position cannot be determined.

System action

The statement cannot be processed.

Programmer response

Take one of the following actions based on the reason-code value:
1
Correct the file name length, file name, and file path. If a relative path is being used for the HFS file, replace it with an absolute path.
2
Correct the file option in the application.
3
Ensure that the file specified exists before attempting to access the file.
4
Delete the file if it is no longer required or specify a file name that does not currently exist.
7
Delete unnecessary files to free up disk space or specify a file that resides on another drive or file system with sufficient disk space. Also, ensure that no operating system or user file size limits were reached. If your application code page uses a multibyte encoding scheme, it is possible that only part of the last character was written. Ensure that the file contains only fully formed characters.
8
The maximum length of the result column must be extended to allow for the expansion that occurs when the string is converted.
9
Correct all errors on the media where the file has been read.
12
Take the appropriate action:
  • Correct the file name to refer to a regular file if it is an HFS file.
  • Correct the file name to refer to a PS or a PO data set if it is a BSAM data set.
  • Correct the file operation to contain the correct action.
13
Correct the error based on the system completion code.

SQLSTATE

428A1

End of change