Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 788
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: 788
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 Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts display the sign only if the value is... useit DFSORT/ICETOOL 3 Wed Oct 04, 2017 5:53 pm
No new posts Binary to display characters Roy Ware SYNCSORT 3 Tue Sep 19, 2017 8:46 pm
No new posts DB2 NULL Values display V S Amarendra Reddy DB2 3 Thu Sep 07, 2017 6:59 pm
No new posts Suppress value reported by BREAK in D... Learncoholic DFSORT/ICETOOL 3 Wed Aug 16, 2017 6:03 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us