View previous topic :: View next topic
|
Author |
Message |
muthuvel
Active User
Joined: 29 Nov 2005 Posts: 217 Location: Canada
|
|
|
|
Hi all,
When i move a COMP-3 variable S9(6) to a display variable S9(6).i don't get the sign moved from the COMP-3 variable to the display variable.
Why is it so?
Please provide suggestions for the same.
Thanks,
Muthuvel. |
|
Back to top |
|
|
jon_s_rice
Active User
Joined: 24 Mar 2005 Posts: 102 Location: Douglasville, GA USA
|
|
|
|
If the display variable you are moving the field to is zone signed that is pic s9(6) without the trailing statement, then the sign will be in the zone bits of the last byte. |
|
Back to top |
|
|
iknow
Active User
Joined: 22 Aug 2005 Posts: 411 Location: Colarado, US
|
|
|
|
Hi Muthuvel,
I have tested using MS-COBOL 85 and I found a peculiar result.
Quote: |
01 a pic s9(6) comp-3 value 111111.
01 b pic s9(6) value 000000.
Inside procedure division,
Move a to b.
display b. |
I am getting the result as 11111A.
Could someone explain this situation. |
|
Back to top |
|
|
jon_s_rice
Active User
Joined: 24 Mar 2005 Posts: 102 Location: Douglasville, GA USA
|
|
|
|
The "A" represents +1. The display does not seperate the sign from a zoned decimal field. |
|
Back to top |
|
|
iknow
Active User
Joined: 22 Aug 2005 Posts: 411 Location: Colarado, US
|
|
|
|
Hi jon_s_rice,
Thanks for your valuable information. Your reply really helped me a lot to avoid confusion about the zoned decimal field. |
|
Back to top |
|
|
|