Results 1 to 7 of 7

Thread: Reason code 16

  1. #1
    Join Date
    Oct 2003
    Posts
    6

    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

    Raja ram

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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.

  3. #3
    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

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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.

  5. #5
    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??

  6. #6
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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).

  7. #7
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •