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: 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 Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Display FTP Session Count within TSO Yolanda Harvey TSO/ISPF 3 Fri Mar 10, 2017 10:31 pm
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts Joinkeys with decimal scdinesh DFSORT/ICETOOL 3 Fri Feb 10, 2017 4:46 am
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm


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