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
 
-310 while inserting two decimal fields in the table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> ABENDS & Debugging
View previous topic :: :: View next topic  
Author Message
Daphne

New User


Joined: 28 Aug 2006
Posts: 27
Location: NY, US

PostPosted: Thu Feb 01, 2007 12:05 am    Post subject: -310 while inserting two decimal fields in the table
Reply with quote

Hi all,

I have two decimal fields in the table in which I am tring to insert.

Field1 decimal(15,2)
Field2 decimal(9,2)

My host variables are defined as
WS-FIELD1 PIC S9(13)V9(2) USAGE COMP-3 VALUE 0.
WS-FIELD2 PIC S9(07)V9(2) USAGE COMP-3 VALUE 0.

respectively.

Still I am getting -310 while inserting.

Appreciate if someone can help me figure this out.

Thanks,
Daphne
Back to top
View user's profile Send private message

DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Thu Feb 01, 2007 2:47 am    Post subject: Re: -310 while inserting
Reply with quote

Daphne,

Please post your exact SQL you are using to do the insert with explination of the column in question.

Thanks,
Back to top
View user's profile Send private message
Daphne

New User


Joined: 28 Aug 2006
Posts: 27
Location: NY, US

PostPosted: Fri Feb 02, 2007 10:22 pm    Post subject:
Reply with quote

Hi David,

Thanks for the reply.

I could resolve the issue after some research.

Here are the details:

The original input host variable is a string variable.

WS-FIELD1-CHAR PIC X(15)

To put it in a packed decimal format, first I moved it into a numeric variable.

WS-FIELD1-DEC REDEFINES
WS-FIELD1-CHAR PIC 9(06)v9(08).


And then moved the numeric to packed decimal.

MOVE WS-FIELD1-DEC TO WS-FIELD1.

When I tried to insert using this host variable WS-FIELD1 I got
-310.

The problem was with the numeric variable. Instead of V(assumed decimal) in the declaration of WS-FIELD1-DEC I had to use the decimal point.

WS-FIELD1-DEC REDEFINES
WS-FIELD1-CHAR PIC 9(06).9(08).


Once I did this change it worked fine. :-)
I don't really know the difference between V and (.) and how it affects this.

Thanks for your time.

Daphne
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: Fri Feb 02, 2007 11:45 pm    Post subject:
Reply with quote

Hi Daphne,

V is an implied decimal.

. is an explicit decimal.
Back to top
View user's profile Send private message
Daphne

New User


Joined: 28 Aug 2006
Posts: 27
Location: NY, US

PostPosted: Sat Feb 03, 2007 2:54 am    Post subject:
Reply with quote

Hi Dick,

Thanks for the reply.

Daphne
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: Sat Feb 03, 2007 3:16 am    Post subject:
Reply with quote

You're welcome icon_smile.gif
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 -> ABENDS & Debugging All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am

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