View previous topic :: View next topic
|
Author |
Message |
Jerry.Sein
New User
Joined: 01 Dec 2011 Posts: 2 Location: US
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Jerry.Sein
New User
Joined: 01 Dec 2011 Posts: 2 Location: US
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
------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 |
|
|
|