IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

failure with -304


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
neelima.sinha

New User


Joined: 14 Sep 2007
Posts: 30
Location: Bangalore

PostPosted: Wed May 13, 2009 6:43 pm
Reply with quote

Hi,

I have a column in my table with data type as below

K_DEN DECIMAL(5,2)

while using in my cobol db2-program it is provided a corresponding data type of

ABC-K-DEN PIC S9(3)V9(2) USAGE COMP-3.

IN MY PROG I HAVE A CURSOR THAT SIMPLY SELECTS K_DEN FROM TABLE AND POPULATES IT INTO CORRESPONDING HOST VARIABLE
ABC-K-DEN.

in doing so it is failing with -304. the value in table was '+402.90' which i believe should be within the range.

can any body help on this please

regards,
Neelima SInha
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed May 13, 2009 7:13 pm
Reply with quote

what is the DCLGENed cobol variable definition?

by the way, the error code is generated based on the possible size (range of values),
not the actual value.

yet another example why host variables should always be the DCLGENed variable
-
and not something dreamed-up by a coder that does not understand DB2 or bother to read the error descriptions
Back to top
View user's profile Send private message
Succor

New User


Joined: 20 Feb 2009
Posts: 96
Location: Bangalore :)

PostPosted: Wed May 13, 2009 10:45 pm
Reply with quote

neelima.sinha,
The cobol varibale definition seems ok.Are you sure the error is being generated for this particular field.Can you post the cursor definition and fetched field definition with the actual error produced while execution.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Thu May 14, 2009 2:47 am
Reply with quote

When receiving an unwanted SQLCODE, you should always display the contents of field SQLERRMC.
This field contains precious information related to the error.

In your case, it would tell you which column in your SELECT is "out-of-sync" with your INTO.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts how to solve this power failure shutd... ABENDS & Debugging 5
No new posts IMS Restart Failure IMS DB/DC 4
No new posts Auto ticketing of a job failure ABENDS & Debugging 1
No new posts Failure after DIR command All Other Mainframe Topics 2
No new posts DB2 utilities, contention or failure? DB2 2
Search our Forums:

Back to Top