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
 

 

conversion of Million and Billion

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
d_sarlie

New User


Joined: 22 Apr 2008
Posts: 32
Location: coimbatore

PostPosted: Mon Oct 15, 2012 4:43 pm    Post subject: conversion of Million and Billion
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Mon Oct 15, 2012 4:49 pm    Post subject: Reply to: conversion of Million and Billion
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: 32
Location: coimbatore

PostPosted: Mon Oct 15, 2012 5:04 pm    Post subject: Re: Reply to: conversion of Million and Billion
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Mon Oct 15, 2012 5:18 pm    Post subject: Reply to: conversion of Million and Billion
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: 642
Location: Whitby, ON, Canada

PostPosted: Mon Oct 15, 2012 5:39 pm    Post subject: Re: Reply to: conversion of Million and Billion
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Mon Oct 15, 2012 5:55 pm    Post subject: Reply to: conversion of Million and Billion
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: 1738
Location: Bloomington, IL

PostPosted: Mon Oct 15, 2012 8:09 pm    Post subject: Re: Reply to: conversion of Million and Billion
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    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 File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Conversion of a VB file to FB. isssal DFSORT/ICETOOL 1 Mon Oct 31, 2016 10:23 pm
No new posts EBCDIC to ASCII conversion using OCOPY mistah kurtz All Other Mainframe Topics 5 Tue Sep 06, 2016 2:26 pm
No new posts Comparex utility to Syncsort conversion mistah kurtz SYNCSORT 11 Fri Jul 22, 2016 1:53 pm
No new posts changing z/os unicode conversion service meykh2014 All Other Mainframe Topics 0 Tue Jul 12, 2016 10:49 am


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