MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Junk Value in SQLCODE

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Problem Determination
View previous topic :: View next topic  
Author Message
arvibala
Beginner


Joined: 12 Feb 2008
Posts: 142
Topics: 67

PostPosted: Thu Nov 11, 2010 12:07 pm    Post subject: Junk Value in SQLCODE Reply with quote

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
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12358
Topics: 75
Location: San Jose

PostPosted: Thu Nov 11, 2010 1:18 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 699
Topics: 63
Location: USA

PostPosted: Thu Nov 11, 2010 1:23 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Problem Determination All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group