|
|
| Author |
Message |
iknow
Senior Member
Joined: 22 Aug 2005 Posts: 582 Location: Colarado, US
|
|
|
|
Hi folks,
What are the truncation rules, when we are moving data in variable of
usage DISPLAY to a variable having usage COMP, COMP2, COMP3. where as sending field is large then the receiving. |
|
| Back to top |
|
 |
References
|
|
 |
Sridevi_C
Active User
Joined: 22 Sep 2005 Posts: 107 Location: Concord, New Hampshire, USA.
|
|
|
|
Hi,
The sending field is converted to the respective COMP format and then moved.For ex.Sending field here,is converted to floating point and then moved for COMP-1 or COMP - 2 receiving field. Truncation rules for numeric is applied.
Regards,
Sridevi. |
|
| Back to top |
|
 |
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1526
|
|
|
|
| The hi ord digits are truncated. |
|
| Back to top |
|
 |
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1526
|
|
|
|
Sorry. My previous reply was incomplete.
The hi ord digits before the decimal point of the longer (in terms of digits) sending field are truncated.
However, the low order digits after the decimal point of the sending field are truncated if their number is greater than that of the receiving field. |
|
| Back to top |
|
 |
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1526
|
|
|
|
Iknow,
If you're still out there give us a sign.
Here's one last comment re. your ques that I should have included:
The truncation I mentioned only works for COMP fields that are present in a pgm compiled w/the TRUNC(STD) option. Any other TRUNC option will not perform as desired.
It's better to use COMPUTE with the ON SIZE ERROR clause to prevent erroneous truncation. |
|
| Back to top |
|
 |
|
|