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
 

 

Sqlcode -310 DECIMAL HOST VARIABLE CONTAINS NON-DECIMAL DATA

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
vasif

New User


Joined: 11 Feb 2008
Posts: 35
Location: Chennai

PostPosted: Tue Jun 05, 2012 8:46 am    Post subject: Sqlcode -310 DECIMAL HOST VARIABLE CONTAINS NON-DECIMAL DATA
Reply with quote

There is a DECIMAL(6,0) db2 column whose cobol dclgen
variable is S9(6)V COMP-3. When trying to use update query on this column thru cob-db2 pgm, i get -310 sqlcode error.

I am taking the input from a CICS map variable declared PICIN=9(4). When i enter 0045 in the cics screen, the symbolic map variable 9(4) contains correct value 0045 only when displayed in the CEEMSG. I even tried moving the symbolic map variable to a temporary COMP-3 variable instead of the dclgen variable and used it as host variable in the update query, but still same prob.

Any solution to this?
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Jun 05, 2012 8:53 am    Post subject:
Reply with quote

Hello,

Suggest you post the host variable defnition, the "temporary" variable definition, the problem sql statement, and the code to move the data from one place to the host variable (assuming this is an insert or update).
Back to top
View user's profile Send private message
vasif

New User


Joined: 11 Feb 2008
Posts: 35
Location: Chennai

PostPosted: Tue Jun 05, 2012 9:08 am    Post subject:
Reply with quote

Map variable GAI PIC 9(04)
Screen Input
Code:

GA CODE         :  0088     


Host variable from DCLGEN
10 HV-GA PIC S9(6)V USAGE COMP-3.

Temporary variable
01 WS-TEMP PIC S9(06)V COMP-3.

MOVE GAI TO HV-GA
MOVE GAI TO WS-TEMP

EXEC SQL
UPDATE RESULTTB
SET GA = :WS-TEMP
WHERE ID = :HV-ID
END-EXEC.

I have used both HV-GA and also WS-TEMP as host variables.
Back to top
View user's profile Send private message
saiprasadh

Active User


Joined: 20 Sep 2006
Posts: 154
Location: US

PostPosted: Tue Jun 05, 2012 9:26 am    Post subject:
Reply with quote

Can you show the 01 level of DCLGEN variable declaration. Did you try to display the host variable value before and after the update.
Back to top
View user's profile Send private message
vasif

New User


Joined: 11 Feb 2008
Posts: 35
Location: Chennai

PostPosted: Tue Jun 05, 2012 9:30 am    Post subject:
Reply with quote

Another wierd observation,

There is another column CHAR(10) which we are updating using the query

Code:

EXEC SQL
   UPDATE RESULTTB
       SET RESULT = 'GOOD' 
       WHERE ID = :HV-ID
END-EXEC.


Even this is giving the -310 error only.
Back to top
View user's profile Send private message
prino

Active Member


Joined: 07 Feb 2009
Posts: 982
Location: Oostende, Belgium

PostPosted: Tue Jun 05, 2012 1:37 pm    Post subject:
Reply with quote

Seems pretty obvious: HV_ID contains garbage.
Back to top
View user's profile Send private message
vasif

New User


Joined: 11 Feb 2008
Posts: 35
Location: Chennai

PostPosted: Tue Jun 05, 2012 7:09 pm    Post subject: Reply to: Sqlcode -310 DECIMAL HOST VARIABLE CONTAINS NON-DE
Reply with quote

And it seems pretty obvious that an assumption was made on HV-ID containing garbage. icon_wink.gif
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Tue Jun 05, 2012 7:35 pm    Post subject:
Reply with quote

Did you try to do any numeric test?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Jun 05, 2012 8:51 pm    Post subject:
Reply with quote

Hello,

Suggest you post the value of :HV-ID in hex.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Tue Jun 05, 2012 10:13 pm    Post subject: Reply to: Sqlcode -310 DECIMAL HOST VARIABLE CONTAINS NON-DE
Reply with quote

Quote:
Post subject: Sqlcode -310 DECIMAL HOST VARIABLE CONTAINS NON-DECIMAL DATA


I wonder why people keep on questioning db2/sql judgement about what is <good> and what is <bad>

what is important is not what the TS thinks/believes but what DB2/SQL wants icon_cool.gif
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 641
Location: Whitby, ON, Canada

PostPosted: Wed Jun 06, 2012 1:07 am    Post subject: Re: Reply to: Sqlcode -310 DECIMAL HOST VARIABLE CONTAINS NO
Reply with quote

vasif wrote:
And it seems pretty obvious that an assumption was made on HV-ID containing garbage. icon_wink.gif
Not really an assumption. It is an hypothesis based on the evidence presented. And a good one too. HV-ID is the next logical thing to check.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Jun 06, 2012 7:22 am    Post subject: Reply to: Sqlcode -310 DECIMAL HOST VARIABLE CONTAINS NON-DE
Reply with quote

So, to repeat:
Quote:
Suggest you post the value of :HV-ID in hex.

d
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 ODPP(Optim Data privacy Provider) Iss... Rama kishore IBM Tools 1 Mon Nov 07, 2016 5:46 pm
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts Can sending 5 MB data between cobol p... Kevin Vaz CICS 12 Tue Oct 18, 2016 4:50 pm
No new posts output data in CSV Format janmejay COBOL Programming 8 Sat Oct 15, 2016 2:20 pm
This topic is locked: you cannot edit posts or make replies. output data in CSV Format janmejay DFSORT/ICETOOL 3 Sat Oct 15, 2016 2:16 pm


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