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

conversion of Million and Billion


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

New User


Joined: 22 Apr 2008
Posts: 42
Location: coimbatore

PostPosted: Mon Oct 15, 2012 4:43 pm
Reply with quote

HI,

I want to convert a value to either Million or Billion.

for eg

The value 4M has to get converted to 4000000
The value 7B has to get converted to 7000000000

Is there are any cobol inbuilt functions which converts this.

Can you please let me know the Possible ways to get this done.

Thanks
Jeba.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Oct 15, 2012 4:49 pm
Reply with quote

There is a list of functions in the manual. When you don't find it there, have a think why that might be.

What are the maximum and minimum values you might receive? Give further examples, which cover all situations, including no M or B if that is possible.
Back to top
View user's profile Send private message
d_sarlie

New User


Joined: 22 Apr 2008
Posts: 42
Location: coimbatore

PostPosted: Mon Oct 15, 2012 5:04 pm
Reply with quote

Bill Woodger wrote:

What are the maximum and minimum values you might receive? Give further examples, which cover all situations, including no M or B if that is possible.



At Font end clients are feeding values like a number and then M or a number then the B.For this I need a conversion logic to display the Zeroes.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Oct 15, 2012 5:18 pm
Reply with quote

Quote:
this I need a conversion logic to display the Zeroes.


no builtin function will provide that,
given moreover that a standard does not exist the multiplier suffixes icon_cool.gif

use reference count to separate the digits from the suffix and apply the proper multiplier
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Mon Oct 15, 2012 5:39 pm
Reply with quote

enrico-sorichetti wrote:

no builtin function will provide that,
given moreover that a standard does not exist the multiplier suffixes icon_cool.gif

use reference count to separate the digits from the suffix and apply the proper multiplier
Indeed. I have worked in places where 4M means 4 thousand (because M is the Roman numeral 1,000) and 4MM means 4 million.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Oct 15, 2012 5:55 pm
Reply with quote

Code:
999,910
1,391M
1.391B
2,476B
3,000B
3Y


Got any like those?

What type of output do you want? A "string" number or a "usual" one (packed/zoned)?

How good is the "front end" verification?
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Mon Oct 15, 2012 8:09 pm
Reply with quote

don.leahy wrote:
enrico-sorichetti wrote:

no builtin function will provide that,
given moreover that a standard does not exist the multiplier suffixes icon_cool.gif

use reference count to separate the digits from the suffix and apply the proper multiplier
Indeed. I have worked in places where 4M means 4 thousand (because M is the Roman numeral 1,000) and 4MM means 4 million.

Note also that to an American "four billion" means 4x10^9, whereas to a European "four billion" means 4x10^12.
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 10 byte RBA conversion DB2 2
No new posts 10 byte RBA conversion -non applicati... JCL & VSAM 1
No new posts file manager is doing string conversion IBM Tools 3
No new posts Copy few lines from SYSOUT of 10 mill... All Other Mainframe Topics 5
No new posts SMF Record Date conversion failing CLIST & REXX 1
Search our Forums:

Back to Top