Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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

Senior Member


Joined: 07 Feb 2009
Posts: 1060
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: 1542
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: 10326
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: 658
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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us