DB2/UDB Stored Procedure SQL0444N Errors

Customers can encounter SQL0444N errors when using IBM DB2/UDB. This article provides the common reasons behind these errors and how to correct them.

The specific DB2 error message received from a stored procedure is as follows:

SQL0444N
Routine "DB2ADMIN.FINDRESPUSER" (specific name "SQL050421110705555") is implemented with code in library or path "\COSP323", function "COSP323" which cannot be accessed. Reason code: "4". SQLSTATE=42724 

According to the IBM documentation:

SQL0444N Routine "<routine-name>:" (specific name "<specific-name>") is implemented with code in library or path "<library-or-path>", function "<function-code-id>" which cannot be accessed. Reason code: "<code>".

Explanation: The DBMS is trying to access the body of the code that implements routine "<routine-name>" (specific name "<specific-name>"), and cannot access it for the reason given by reason code "<code>" (the codes are listed below). The file implementing the routine is identified by "<library-or-path>" and the function by "<function-code-id>".

Reason code 4 indicates: The file in "<library-or-path>" could not be found. See the routine creator or your database administrator. The routine definition or the location of the routine may need to be corrected, or the routine may need to be re-linked.

In addition to the above, this reason code can result if the routine requires a shared library or .DLL, and the shared library cannot be located (using the concatenation of directories specified in the LIBPATH environment variable in UNIX-based systems, the PATH environment variable in Windows systems). There can be multiple levels of this indirection involved, leading to this reason code. For example, routine body X can be found, and it needs shared library Y which can also be found. However, since Y needs Z and Z cannot be located, and this will also result in SQL0444N reason code 4.

Resolution:

  1. Make sure the cblrtss.dll or cblrtsm.dll is copied to the sqllib\function directory
  2. Make sure the name of stored procedure from the CREATE PROCEDURE statement corresponds to the name specified in the EXTERNAL NAME clause of the create procedure statement and that the .DLL name of the stored procedure is in sync with the EXTERNAL NAME clause: 
        ex. CREATE PROCEDURE GETEMPSVR
            (IN  EMPNO CHAR(6),
            INOUT SQLCD    INT ,
            OUT FIRSTNME CHAR(12),
            OUT LASTNAME CHAR(12),
            OUT HIREDATE CHAR(10),
            OUT SALARY   DEC(9,2) )
            LANGUAGE COBOL
            EXTERNAL NAME 'GETEMPSVR!GETEMPSVR'
            PARAMETER STYLE DB2SQL;
    
    The .DLL name would be GETEMPSVR.DLL as identified in EXTERNAL NAME clause and the stored procedure name is GETEMPSVR as identified in create procedure & external name clause. 

For more information on DB2 stored procedures please refer to:
     Net Express Docs>Help>Contents
     Programming
       Database Access
         Database Access Book
           Part 3: DB2
             11: Stored Procedures
               DB2 Stored Procedures 

Reference Knowledge Base Document #20615