var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: 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
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.
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
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.
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??
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).
just now tried that bit and the program was successful!!!!!
Don't know why or where I am going wrong