View previous topic :: View next topic
|
Author |
Message |
shubh
New User
Joined: 01 Oct 2007 Posts: 16 Location: USA
|
|
|
|
hi,
i am getting a file from a cobol program in which one of the field is defined as PIC S9(2)V9(4)
I need to transfer this file into a table in the database(Teradata).
when the field has values 000000, the transfer is successful.
however, when the field has some values other than zero like:
005900, 002900, 001900, it gives me a numeric overflow error.
my target table has that field defined as Decimal(6,4) which means it can have total 6 digits, 2 before decimal and 4 after decimal.
Can anyone let me know why i am getting the error while transfer?
Am i interpreting the incoming field correctly? |
|
Back to top |
|
|
stodolas
Active Member
Joined: 13 Jun 2007 Posts: 632 Location: Wisconsin
|
|
|
|
The V means an implied decimal in cobol and it won't appear in the output file. You are trying to load 5900.00 into the database table and it doesn't fit because your largest allowable value is 99.9999 |
|
Back to top |
|
|
shubh
New User
Joined: 01 Oct 2007 Posts: 16 Location: USA
|
|
|
|
ok.
I understood the mistake.
Does that mean PIC S9(9)V9(2) means decimal(11,9) (max value = 99.999999999, total digits 11)
PIC S9(2)V9(4) mean decimal(6,2) (max value = 9999.99, total digits 6) |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
shubh wrote: |
hi,
i am getting a file from a cobol program in which one of the field is defined as PIC S9(2)V9(4)
I need to transfer this file into a table in the database(Teradata).
when the field has values 000000, the transfer is successful.
however, when the field has some values other than zero like:
005900, 002900, 001900, it gives me a numeric overflow error.
my target table has that field defined as Decimal(6,4) which means it can have total 6 digits, 2 before decimal and 4 after decimal.
Can anyone let me know why i am getting the error while transfer?
Am i interpreting the incoming field correctly? |
Does Teradata require the actual decimal point. It may be trying to transfer your numbers as whole numbers (all three examples you give would fail in that case). |
|
Back to top |
|
|
shubh
New User
Joined: 01 Oct 2007 Posts: 16 Location: USA
|
|
|
|
teradata does require the actual decimal point
i applied a conversion at the database end and it worked fine
field (DECIMAL(6,4),FORMAT'9(2)V9(4)S'
however i want to confirm my understanding:
PIC S9(x)V9(y) means
total digits = x+y
Digits after decimal = y
Please suggest.
Thanks
Shubhangi |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
PIC S9(x)V9(y) means
total digits = x+y
Digits after decimal = y
|
Yes, that is correct. |
|
Back to top |
|
|
shubh
New User
Joined: 01 Oct 2007 Posts: 16 Location: USA
|
|
|
|
Thanks......it cleared my doubts |
|
Back to top |
|
|
|