Why does Detector display a -253 error code, when my application displays a -302 error code?

Document ID : KB000014170
Last Modified Date : 14/02/2018
Show Technical Document Details
Introduction:

This document states why Detector may display a -253 error code, when an application displays a -302 error code.

Question:

Why does Detector display a -253 error code, when my application displays a -302 error code? 

Environment:
z/OS 1.11 and above.
Answer:

Detector displays the SQL Error that it finds in the DB2 control block. In this case, a -253 SQL error appeared in the control block, therefore, Detector displayed it instead of a -302 error. It's possible that DB2 changed the SQLCODE from -253 to -302 during post SQL processing.