SQLCODE IN GLOBDATA

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

We have a Gen program which we call from a started task. GLOBDATA is initiated with SPACES.  We want to evaluate the result from the called action block.

Question:

We extract the SQLCODE from the SQLCA area and want to display it, but it does not show. What needs to be done to display it?  

Answer:

The SQLCODE from the SQLCA area doesn't show since it is stored binary.

To be able to display it, you must apply formatting on the SQLCA area. The SQLCODE can be found as an integer (4 bytes) starting at position 13 in the SQLCA area.