IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

cobol file transfer


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shubh

New User


Joined: 01 Oct 2007
Posts: 16
Location: USA

PostPosted: Wed Dec 12, 2007 2:23 am
Reply with quote

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
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Wed Dec 12, 2007 2:25 am
Reply with quote

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
View user's profile Send private message
shubh

New User


Joined: 01 Oct 2007
Posts: 16
Location: USA

PostPosted: Wed Dec 12, 2007 2:32 am
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Dec 12, 2007 2:38 am
Reply with quote

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
View user's profile Send private message
shubh

New User


Joined: 01 Oct 2007
Posts: 16
Location: USA

PostPosted: Wed Dec 12, 2007 2:49 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Dec 12, 2007 2:54 am
Reply with quote

Hello,

Quote:
PIC S9(x)V9(y) means
total digits = x+y
Digits after decimal = y
Yes, that is correct.
Back to top
View user's profile Send private message
shubh

New User


Joined: 01 Oct 2007
Posts: 16
Location: USA

PostPosted: Thu Dec 13, 2007 12:27 am
Reply with quote

Thanks......it cleared my doubts 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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 8
No new posts Replace each space in cobol string wi... COBOL Programming 2
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top