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: 989
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: 1531
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: 10211
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: 642
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 Sorting group data rajella DFSORT/ICETOOL 3 Sun Jan 22, 2017 11:32 pm
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 1 Mon Jan 02, 2017 11:16 am
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm


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