IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Display 20 digit decimal


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sun_job

New User


Joined: 18 Sep 2007
Posts: 73
Location: Bangalore

PostPosted: Wed May 12, 2010 2:09 pm
Reply with quote

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
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Wed May 12, 2010 2:26 pm
Reply with quote

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
View user's profile Send private message
sun_job

New User


Joined: 18 Sep 2007
Posts: 73
Location: Bangalore

PostPosted: Wed May 12, 2010 2:43 pm
Reply with quote

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
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Wed May 12, 2010 2:53 pm
Reply with quote

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
View user's profile Send private message
sun_job

New User


Joined: 18 Sep 2007
Posts: 73
Location: Bangalore

PostPosted: Wed May 12, 2010 3:21 pm
Reply with quote

Thanks for your Gnana
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Need Help with Packed Decimal Signs DFSORT/ICETOOL 4
No new posts Select a DB2 value in a specific deci... DB2 4
No new posts String has hex character need to conv... COBOL Programming 3
No new posts How to display the leading zeros of a... DB2 7
Search our Forums:

Back to Top