Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

failure with -304

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: failure with -304
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    Post subject:
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    Post subject: Reply to: failure with -304
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: 1224
Location: Israel

PostPosted: Thu May 14, 2009 2:47 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ALLOCATE REXX PDS to SYSPROC failure mambopras CLIST & REXX 4 Sat Apr 04, 2015 10:14 am
No new posts OPC/Tivoli OCL failure (line 1560) David Robinson IBM Tools 14 Mon Dec 01, 2014 7:13 am
No new posts FTINCL failure code 20 Invalid contro... Steve Coalbran TSO/ISPF 2 Mon Aug 04, 2014 10:44 am
No new posts Alter Table - Failure gylbharat DB2 7 Wed Jul 03, 2013 5:10 pm
No new posts Bind Failure : Resource not available... prasun dhara DB2 2 Fri May 10, 2013 9:49 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us