Will take numbers with decimal point or not.
/* rexx */
bytes = 1234567.89
parse var bytes num '.' dec
num=strip(translate('0,123,456,789,abc,def', ,
          right(num,16,','), ,
          '0123456789abcdef'),'L',',')
bytes = strip(strip(num)||'.'||dec,'T','.')
say bytes

On Fri, Jan 4, 2013 at 4:02 PM, Roberto Halais <roberto.hal...@gmail.com>wrote:

> /* rexx */
> num = '123,456,789'
> num = space(translate(num,'',','),0)
> say num
>
> 123456789
>
>
>
> On Fri, Jan 4, 2013 at 3:48 PM, John McKown 
> <john.archie.mck...@gmail.com>wrote:
>
>> sure
>>
>> nocommas=strip(input,"b",",")
>>
>> http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IKJ4A390/4.3.55
>>
>>
>>
>> On Fri, Jan 4, 2013 at 1:44 PM, Bill Ashton <bill00ash...@gmail.com>
>> wrote:
>> > Now, on a related note...is there a simple way to remove commas from a
>> > number that is input as a string?
>> >
>> > For example, if a variable has "2,143,628" in it, how can I easily strip
>> > the commas to wind up with 2143628?
>> >
>> > Billy
>> >
>> > On Fri, Jan 4, 2013 at 1:58 PM, Lionel Dyck <lionel.d...@us.ibm.com>
>> wrote:
>> >
>> >> The 'extra' comman before the .12 on the second example as just that
>> the
>> >> code does not handle numbers with decimal but works well with pure
>> numbers
>> >>
>> >>
>> >>
>> >> Lionel B. Dyck <><
>> >> z Client Architect
>> >> IBM Corporation - West IMT
>> >>
>> >> Mobile Phone: 1-925-207-4518
>> >> E-mail: lionel.d...@us.ibm.com
>> >> System z: www-03.ibm.com/systems/z/
>> >> Linux on z: http://www-03.ibm.com/systems/z/os/linux/
>> >> Destination z:
>> http://www-03.ibm.com/systems/z/destinationz/index.html/
>> >>
>> >> "Think Inside the z Box"
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> From:   Mark Zelden <m...@mzelden.com>
>> >> To:     IBM-MAIN@listserv.ua.edu,
>> >> Date:   01/04/2013 10:54 AM
>> >> Subject:        Re: Formatting a Number with comma's
>> >> Sent by:        IBM Mainframe Discussion List <
>> IBM-MAIN@listserv.ua.edu>
>> >>
>> >>
>> >>
>> >> On Fri, 4 Jan 2013 10:43:18 -0800, Lionel Dyck <lionel.d...@us.ibm.com
>> >
>> >> wrote:
>> >>
>> >> >I ran across this code from Doug Nadel several years ago and hope that
>> >> >y'all will find it useful.
>> >> >
>> >> >
>> >> >          /* ----------------------------------------------------- */
>> >> >          /* number format code thanks to Doug Nadel               */
>> >> >          /* ----------------------------------------------------- */
>> >> >           str=strip(translate('0,123,456,789,abc,def', ,
>> >> >                           right(bytes,16,','), ,
>> >> >                           '0123456789abcdef'),'L',',')
>> >> >           bytes = strip(str)
>> >> >
>> >> >Here are two examples from oorexx under windows (this works well under
>> >> >z/OS and z/VM)
>> >> >
>> >> >C:\t\new>test.rex 12345678
>> >> >Bytes: 12,345,678
>> >> >
>> >> >C:\t\new>test.rex 12345678.12
>> >> >Bytes: 12,345,678,.12
>> >> >
>> >> >
>> >>
>> >> May need a tweak (or cut/paste does).  What's that extra comma before
>> >> the decimal point in the 2nd example?
>> >>
>> >> There was a recent thread on the TSO-REXX list that had some
>> >> nice examples - probably including this one (I don't follow TSO-REXX
>> >> too closely).
>> >>
>> >> --
>> >> Mark Zelden - Zelden Consulting Services - z/OS, OS/390 and MVS
>> >> mailto:m...@mzelden.com
>> >> Mark's MVS Utilities: http://www.mzelden.com/mvsutil.html
>> >> Systems Programming expert at
>> http://expertanswercenter.techtarget.com/
>> >>
>> >> Mark
>> >>
>> >> ----------------------------------------------------------------------
>> >> For IBM-MAIN subscribe / signoff / archive access instructions,
>> >> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>> >>
>> >>
>> >>
>> >> ----------------------------------------------------------------------
>> >> For IBM-MAIN subscribe / signoff / archive access instructions,
>> >> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>> >>
>> >
>> >
>> >
>> > --
>> > Thank you and best regards,
>> > *Billy Ashton*
>> >
>> > ----------------------------------------------------------------------
>> > For IBM-MAIN subscribe / signoff / archive access instructions,
>> > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>>
>>
>>
>> --
>> Maranatha! <><
>> John McKown
>>
>> ----------------------------------------------------------------------
>> For IBM-MAIN subscribe / signoff / archive access instructions,
>> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>>
>
>
>
> --
> "Men will never be free until the last king is strangled with the entrails
> of the last priest." Denis Diderot




-- 
"Men will never be free until the last king is strangled with the entrails
of the last priest." Denis Diderot

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to