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 

DB2 Stored Procedure - NULL Indicator issue.

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


Joined: 10 Jan 2007
Posts: 33
Topics: 12

PostPosted: Tue May 22, 2007 7:48 am    Post subject: DB2 Stored Procedure - NULL Indicator issue. Reply with quote

My DBA has defined a stored procedure with NULL-Indicator as SMALLINT.
In the Underlying COBOL-SQL Stored procedure we have defined that as S9(04) COMP. It will be invoked by the JAVA front end.
The Problem is Eventhough we move some numeric values (say -1,5 etc.) in the NULL indicaor fields it gives only ZERO in the output(front end).

So for debugging purpose we added Display statements to Display the value of the NULL indicators after moving -1 into the same We got (in the Corressponding DB2 job Spool)
Code:
ENT-CODE-NULLIND  0000J
PROD-CD-NULLIND   0000J
WAR-NAME-NULLIND 0000J
WAR-MESG-NULLIND 0000J .


Also the other thing to be noted here is S9(4) comp displays 5 bytes. Please clarify what cud be the problem...
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue May 22, 2007 9:00 am    Post subject: Reply with quote

arshadh,

0000J is indeed -1. Cobol converts the display with sign overpunch on the last byte.

check this link which explains about the sign

http://www.mvsforums.com/helpboards/viewtopic.php?t=2906&highlight=overpunch

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
arshadh
Beginner


Joined: 10 Jan 2007
Posts: 33
Topics: 12

PostPosted: Tue May 22, 2007 9:41 pm    Post subject: Reply with quote

But the front end Java program shows the NULL inicator value as zero '0'. I think it considers only the first four bytes... Help me to resolve the issue
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue May 22, 2007 9:48 pm    Post subject: Reply with quote

arshadh,
Move the null ind defined as S9(04) COMP to a variable defined as -9(3) and read this variable in java.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
arshadh
Beginner


Joined: 10 Jan 2007
Posts: 33
Topics: 12

PostPosted: Wed Jul 11, 2007 11:47 pm    Post subject: Reply with quote

Dear All,

The Problem was with myself. I declared all the linkage section variables under one 01 level. But my seniors told me to decalre them as indivdual 01 level variables.. Then the problem was solved and the right values to and fro the Stored procedure.

Thanks a lot kolusu..
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database 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