View previous topic :: View next topic
|
Author |
Message |
sun_job
New User
Joined: 18 Sep 2007 Posts: 73 Location: Bangalore
|
|
|
|
Hi,
I want to display a value which is having 20 decimal places. I have declared as
77 WS-X PIC S9(11)V9(20) USAGE COMP-3.
then i move a value of
MOVE 0.000065548255994341 TO WS-X, but in the output i get only
WS-X: 000000000065548
The rest is truncated. is there any way to get the full value. Please help |
|
Back to top |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
Hi,
I tried this.
Code: |
77 WS-X PIC S9(11)V9(20) USAGE COMP-3.
PROCEDURE DIVISION.
0000-MAIN-PARA.
MOVE 0.000065548255994341 TO WS-X
DISPLAY WS-X |
Got this.
Code: |
0000000000000006554825599434100 |
Missing something? Please let me know. |
|
Back to top |
|
|
sun_job
New User
Joined: 18 Sep 2007 Posts: 73 Location: Bangalore
|
|
|
|
Hi Gnana,
Thanks for your comment.
There was a compiler option i need to set , to accommodate 31 bytes, Its working fine now.
Thanks |
|
Back to top |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
Hi,
The option is ARITH(EXTEND). In your case, if ARITH is not EXTEND, Compile does fail, right? Then how would you get the output you shown in the first post? Am I missing anything?
And, if you want to display COMP-3, better to move it to edited-numeric and display for better readability. |
|
Back to top |
|
|
sun_job
New User
Joined: 18 Sep 2007 Posts: 73 Location: Bangalore
|
|
|
|
Thanks for your Gnana |
|
Back to top |
|
|
|