View previous topic :: View next topic |
Author |
Message |
arvibala Beginner
Joined: 12 Feb 2008 Posts: 142 Topics: 67
|
Posted: Thu Nov 11, 2010 12:07 pm Post subject: Junk Value in SQLCODE |
|
|
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 _________________ Arvind
"You can make a difference with your smile. Have that with you always" |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Thu Nov 11, 2010 1:18 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
Dibakar Advanced
Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Thu Nov 11, 2010 1:23 pm Post subject: |
|
|
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. _________________ Regards,
Diba |
|
Back to top |
|
|
|
|