View previous topic :: View next topic
|
Author |
Message |
kanishka
New User
Joined: 02 Apr 2005 Posts: 3
|
|
|
|
Hello everyone,
When I try to move s9(2)v(3) comp-3 to s9(2)v(3) variable,
Iam not able to get the sign.
i,e If I move -5.000 stored in comp-3 variable to s9(2)v(3) variable , the result that is getting displayed is 05000.
Can anyone explain me why this is happening
Thanks in advance.
Kanishk |
|
Back to top |
|
|
nitin4.a
New User
Joined: 16 Aug 2005 Posts: 26
|
|
|
|
HI
These are the specifications about comp-3 and comp variables,might be it will help you
Sign is stored in comp-3 as:-It is stored in the last nibble. For example if your number is +100, it stores hex 0C in the last byte, hex 1C if
your number is 101, hex 2C if your number is 102, hex 1D if the number is -101, hex 2D if the number is -102
etc...
also it is a packed decimal format
S9(7) COMP-3 field occupy 4 bytes and . Sign is stored as hex value in the last nibble
S9(7) SIGN TRAILING SEPARATE will take 8 bytes (one extra for sign)
regards
sonu |
|
Back to top |
|
|
Sridevi_C
Active User
Joined: 22 Sep 2005 Posts: 104 Location: Concord, New Hampshire, USA.
|
|
|
|
Hi,
Sign doesn't contribute to the size of the data name: s9(2)v9(3) usage display.For display purpose,edit characters can be used, -9(2)v9(3) usage display.Now your result must be -05000.
Regards,
Sridevi. |
|
Back to top |
|
|
|