If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Reason code 16

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-15-03, 16:30
vidhya vidhya is offline
Registered User
 
Join Date: Oct 2003
Posts: 6
Reason code 16

We are in DB2 Ver 7.1 and we use LE

I have a COBOL code which does a dynamic prepare statement.

I managed to declare the cursor successfully.

I manged to get the first record successful. After the first fetch, i am trying out parsing the data and writting onto file.

The problem is that if i try to fetch the next row I am getting 804 sqlcode. The reason code is 16.

Anyone can help me out in this

Raja ram
Reply With Quote
  #2 (permalink)  
Old 10-15-03, 18:15
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
1. What operating system are you on? Windows, Unix, OS/390?

2. Is the return code -804 or 804. DB2 has negative and positive SQL return codes.

3. What does the Messages and Codes manual say? Go to http://www-3.ibm.com/software/data/db2/library/ for DB2 manuals.

4. Don't manipulate any data in the SDLDA. Move it another part of working storage and then manipulate it.
Reply With Quote
  #3 (permalink)  
Old 10-15-03, 19:13
vidhya vidhya is offline
Registered User
 
Join Date: Oct 2003
Posts: 6
1) We are in Z/OS V1R4
2) The RC is -804
3) For RC of -804 and Reason code of 16, it denotes " Unrecognized output data type".
4) We are manpulating in Working storage rather than in host variable
Reply With Quote
  #4 (permalink)  
Old 10-15-03, 19:30
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
So I assume you are using "SELECT INTO ..."

Are you sure that the data type for the host variable is the correct one for the DB2 column? Is the column a computed column or a table column?

If it's a table column, you might want to use DCLGEN to make sure you have the right COBOL definition. If it's computed, make sure it is large enough to handle all possible values.
Reply With Quote
  #5 (permalink)  
Old 10-15-03, 19:33
vidhya vidhya is offline
Registered User
 
Join Date: Oct 2003
Posts: 6
We have got a declare cursor in our dynamic SQL. Hence the code wherein we are getting a -804 is during FETCH statement.

The DCLGEN and the column of table perfectly match.

Just bit curious...what would be the issue if we manpulate the host variable directly in our processing part??
Reply With Quote
  #6 (permalink)  
Old 10-15-03, 19:39
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
I would not think that manipulating the host variable is a problem, unless it is in the SQLDA. I don't really know what the problem is. You might try coding two consecutive fetches without any other code executed (except looking at return code).
Reply With Quote
  #7 (permalink)  
Old 10-15-03, 19:40
vidhya vidhya is offline
Registered User
 
Join Date: Oct 2003
Posts: 6
just now tried that bit and the program was successful!!!!!

Don't know why or where I am going wrong
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On