This is by far the easiest, if not the simplest, solution. There was, once upon 
a time, an example in an IBM pub, but for the life of me, I cannot recall 
where. Still, one TR will do it; create a result field whose bytes are indexes 
into the source value treated as a TR table such that only the numeric values 
are selected. Easy. Thanks for reminding me, Robin.

Mike

At 01:34 AM 10/18/2016, you wrote:

>Using TR in a different way omits the commas and decimal point, sign,
>and any other funny characters. 
>To do this, you swap the roles of the translate table and the string
>being translated.
>
>----- Original Message -----
>From: "IBM Mainframe Assembler List" 
>To:
>Cc:
>Sent:Mon, 17 Oct 2016 16:24:18 -0400
>Subject:Re: converting character to packed
>
> The TR command would leave all the non-numeric characters in the
>data, translated as you specified, so you'd have to have a technique
>to pass through the result to remove them. A TRT instruction would
>help you find the non-numeric characters, but in this case it would be
>considerably slower in execution than the character by character loop
>approaches suggested.
>
> If the original manually-entered data is not edited as it's entered,
>there could be many other characters besides "$",",","." and EBCDIC
>numeric characters in it. That's something TRT could check for.
>
> Gary Weinhold
> Senior Application Architect
>
> __________
>
> On 2016-10-17 15:11, robi...@dodo.com.au wrote:
>
> Won't a TR followed by a PACK do this?
>Email sent using Dodo Webmail

Reply via email to