Junk Value in SQLCODE
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> Problem Determination

#1: Junk Value in SQLCODE Author: arvibala PostPosted: Thu Nov 11, 2010 12:07 pm
    —
Hi,

I have few DB2 queries in a Module.

I call this Module from another Module and check for its SQLCODE. If there are any query failure I get proper Return Code in the SQLCODE. But if I have a successful run of the Module, the SQLCODE should be ZERO right? But it shows some Value

Here is the code and Output

Code:

CALL WS-STYHIVFD USING XSTY0000-COMMON-ERR-PARM
                       XSTYIVFD-COMM           
MOVE XSTY0000-DBMS-ERR-MSG TO SQLCA       
DISPLAY 'SQLCODE AFTER STYHIVFD ' SQLCODE


Output when a good run
Code:

SQLCODE AFTER STYHIVFD 1077952576


Output during error
Code:

SQLCODE AFTER STYHIVFD 000000080N



Why am I getting the Value "1077952576" for a successful run? and how to avoid that?

Cheers

#2:  Author: kolusuLocation: San Jose PostPosted: Thu Nov 11, 2010 1:18 pm
    —
arvibala,

You are overlaying the contents of XSTY0000-DBMS-ERR-MSG on to SQLCA which contains the SQLCODE. I would bet that you are NOT initializing the XSTY0000-DBMS-ERR-MSG area.

Kolusu

#3:  Author: DibakarLocation: USA PostPosted: Thu Nov 11, 2010 1:23 pm
    —
The answer is in the called program STYHIVFD.

Someone noticed in another forum that 1077952576 is same as Hex (40404040).

Maybe called program is initializing the binary field corresponding to SQLCODE by spaces instead of Zeroes.



MVSFORUMS.com -> Problem Determination


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group