I'm trying to call a stored procedure called CloseOrder on an AS/400 (running DB2) from a PowerBuilder app using ODBC.

The ODBC DSN has a library path specified, as follows, and I'm using SQL naming conventions:
NULLID,OPSENV,OPSJRN,OPSDTA,OPSOBJ,OPSGPL


This is the error I'm getting in the joblog on the AS/400:
Pointer not set for location referenced
Application errror. MCH3601 unmonitored by CloseOrder
Trigger program or external routine detected an error

If I remove the library path from the ODBC DSN then CloseOrder works (but some other part of the app breaks).

Any ideas?