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
 
cobol file transfer

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: cobol file transfer
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    Post subject:
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    Post subject: Reply to: cobol file transfer
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    Post subject: Re: cobol file transfer
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    Post subject: Reply to: cobol file transfer
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

Site Director


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

PostPosted: Wed Dec 12, 2007 2:54 am    Post subject:
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    Post subject: Reply to: cobol file transfer
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm
No new posts unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am

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