PowerBuilder calling a db2 stored procedure results in a sqlstate=38503 SQL1131N error

Symptom

When PowerBuilder is connected to DB2 using ODBC and calling a stored procedure written in COBOL using RPC, the following DB2 error message is returned:

SQLSTATE=38503
[IBM][CLI Driver][DB2/NT64] SQL1131N A stored procedure process has been terminated abnormally

Environment

  • PowerBuilder

  • ODBC

  • IBM DB2

Reproducing the Issue

  1. In PowerBuilder, connect to DB2 using ODBC.

  2. Call a stored procedure that is written in COBOL.

  3. The following DB2 error message may be returned:

    SQLSTATE=38503
    [IBM][CLI Driver][DB2/NT64] SQL1131N A stored procedure process has been terminated abnormally

Cause

DB2 server error

Solution

Add CURRENTFUNCTIONPATH='XXX' in the db2cli.ini file where 'XXX' is the schema name and

Add PBUSEPROCOWNER='YES' in the pbodbcXXX.ini file where XXX is the PowerBuilder version (for example, pbodbc220.ini).