IBM Books

Administration Guide

Error Handling

In order for the database manager to properly handle the return codes from the user exit program, the program must be coded to provide specific return codes to show specific results.

Table 120 shows the return codes that can be returned by a user exit program. and how the database manager interprets that return code. If a return code is not listed in the table, it is treated as if its value were 32.

Table 120. User Exit Return Codes and Results
Return Code Result (Note 1) Explanation
0 -- Successful.
4 Note 2 Temporary resource error encountered.
8 Note 2 Operator intervention is required.
12 Note 3 Hardware error.
16 Note 3 Error with the user exit program or a software function used by the program.
20 Note 3 Error with one or more of the parameters passed to the user exit program. Verify that the user exit program is correctly processing the parameters provided.
24 Note 3 The user exit program was not found. For OS/2 this error message also means that a file needed to complete a RESTORE DATABASE operation could not be found in the current backup media.
28 Note 3 Error caused by an I/O failure or the operating system.
32 (and all other values) Note 3 The user exit program was terminated by the user.


  1. Applies to archive and retrieve actions only.

  2. For archive and retrieve, a return code of 4 or 8 causes a retry in five minutes.

  3. No further user exit program requests will be sent for this database while the database is open for processing. If all applications disconnect from the database and then the database is reopened, the request will be repeated.

    If the user exit program was called to archive log files, your disk can be filled with log files and performance may be degraded because of extra work to format these log files. Once the disk becomes full, database manager will not accept further application requests for database changes.

    If the user exit program was called to retrieve log files, roll-forward recovery is suspended but not stopped unless a stop was specified in the ROLLFORWARD DATABASE utility. If a stop was not specified, you can correct the problem and resume recovery.

  4. For archive and retrieve actions, an alert message is issued for all return codes except 0, 4, and 24. The alert message contains the return code from the user exit program and a copy of the input parameters that were provided to the user exit program.

Because the user exit program is called by the underlying operating system command processor, there is a possibility that non-zero return codes are returned from the operating system. These error codes are not remapped. Consult the operating system message help information for a description of those error codes.

Error Handling for OS/2:

For the BACKUP DATABASE and RESTORE DATABASE utilities, any non-zero return code returned by a user exit program causes the utility to fail and no retry is attempted. The utilities report a general SQLCODE -2029. The message text for this SQLCODE displays the return code returned from the user exit program or from the operating system.

[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]