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
 

 

-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 DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm
No new posts Joinkeys with decimal scdinesh DFSORT/ICETOOL 3 Fri Feb 10, 2017 4:46 am


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