Simple Mainframe Universe
Home Tutorials Interview Q&A Quiz Mainframe Memes Contact us About us

Db2 Troubleshooting


SQLCODE -440 routine not found

SQLCODE -440: routine not found — the stored procedure or function does not exist with a matching signature.

What it means

  • After every EXEC SQL, DB2 returns a SQLCODE: 0 means success, +100 means no row found, and negative values mean an error.

Common causes

  • Wrong procedure name or schema.
  • Parameter count/types do not match any defined routine.
  • Routine not created in this environment.

How to diagnose

  • List routines in the catalog for that schema.
  • Compare parameter signatures.

How to fix it

  • Correct the CALL signature.
  • Create/grant the routine in the target environment.

Example: Match the routine signature

* CALL SCHEMA.PROC(:a, :b) must match defined parameters * exactly - count and types.

Signature mismatches are the usual -440.

Interview tip

  • Q: How would you troubleshoot a SQLCODE -440 routine not found in production?
  • A: I would check the SQLCODE and SQLERRM immediately after the failing statement, reproduce in SPUFI, then apply the specific fix.

Prevention checklist

  • Always check SQLCODE after every EXEC SQL statement.
  • Log the SQLCODE, SQLSTATE and failing statement for support.




© copyright mainframebug.com
Privacy Policy
MainframeBug Assistant