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
 

 

Data Truncation Issue

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Jerry.Sein

New User


Joined: 01 Dec 2011
Posts: 2
Location: US

PostPosted: Fri Dec 02, 2011 1:57 am    Post subject: Data Truncation Issue
Reply with quote

Hi ,

Can any one suggest me the corect way to do this

File field 1 (Data Type: S9(6)V99)
Screen field (Data Type: X(9))
WS variable field (Data Type: - - - - - 9.99)

I am having a data truncation error of 1 byte when Data is moved from file field 1 to Working storage which needs to be then moved to screen field
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7990
Location: Bellevue, IA

PostPosted: Fri Dec 02, 2011 2:02 am    Post subject:
Reply with quote

The V in PIC S9(7)V99 is an IMPLIED decimal point -- it does not really exist. You are moving a 9-byte data field to a numeric edited data field that has 8 numeric postiions (5 dashes which can be numeric digits, the 9 before the decimal point, and the 2 digits after the decimal point). If you move 9 digits to 8 digits, you're going to lose a digit.
Back to top
View user's profile Send private message
Jerry.Sein

New User


Joined: 01 Dec 2011
Posts: 2
Location: US

PostPosted: Fri Dec 02, 2011 2:24 am    Post subject:
Reply with quote

So should I update the receiving field to -----99.99. Will this help ?
i tried changing it to ZZZZZZ.ZZ .

If I do this it actually gets the amounts correctly without truncation ?
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 Dec 02, 2011 2:59 am    Post subject:
Reply with quote

Hello and welcome to the forum,

Suggest you try a few experiments with different lengths and edit masks.

Keep in mind that the "v" is an implied decimal point and will align to the actual decimal point in edited output.

If any of these experiments give unexpected results, please post the field definitions and the output value generated.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Fri Dec 02, 2011 3:10 am    Post subject: Reply to: Data Truncation Issue
Reply with quote

Because the sending numeric field is signed, do you need the map data displayed with a prefixed or suffixed '-' or '+'?

Mr. Bill
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7990
Location: Bellevue, IA

PostPosted: Fri Dec 02, 2011 5:20 am    Post subject:
Reply with quote

------9.99 or -----99.99 will work as long as your numbers are positive but NOT ZZZZZZ.ZZ since you only have six digits before the decimal point. Ideally, you should use -------9.99 or ------99.99 (7 digits before the decimal point plus one for the sign, along with the 2 after the decimal point). Note that the X(9) variable must be changed to X(10) [or X(11) to accommodate the decimal point and the sign] and your map must reflect the increased length as well.
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 Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm
No new posts JCL to get submitted once dataset has... vinu78 JCL & VSAM 17 Thu Feb 16, 2017 7:32 am


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