Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Display 20 digit decimal

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Display 20 digit decimal
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: 785
Location: Chennai, India

PostPosted: Wed May 12, 2010 2:26 pm    Post subject:
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    Post subject:
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: 785
Location: Chennai, India

PostPosted: Wed May 12, 2010 2:53 pm    Post subject: Reply to: Display 20 digit decimal
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Display ZEDLMSG without Pressing F1 &... anandgbe CLIST & REXX 8 Thu Dec 15, 2016 4:20 pm
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts How to display value of an exit param... lind sh CICS 2 Sun Oct 09, 2016 12:28 pm
This topic is locked: you cannot edit posts or make replies. DSList (3.4) cannot display Chinese c... jacobdng TSO/ISPF 4 Wed Oct 05, 2016 2:51 pm
This topic is locked: you cannot edit posts or make replies. Get and display content of an address... lind sh CICS 1 Mon Aug 08, 2016 9:18 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us