Re: converting character to packed

2017-08-16 Thread Robin Vowels
From: "Paul Gilmartin" <0014e0e4a59b-dmarc-requ...@listserv.uga.edu> Sent: Monday, October 24, 2016 5:49 AM On 2016-10-23, at 06:05, robi...@dodo.com.au wrote: Monetary fields tend to have the finny characters in known positions, commas (or periods)every third position. The decimal

Re: converting character to packed

2016-10-23 Thread Paul Gilmartin
On 2016-10-23, at 06:05, robi...@dodo.com.au wrote: > Monetary fields tend to have the finny characters in known positions, > commas (or periods)every third position. The decimal point (period or > comma) also is in a fixed position.All these are in fixed positions > relative to the least

Re: converting character to packed

2016-10-23 Thread robin51
Monetary fields tend to have the finny characters in known positions, commas (or periods)every third position. The decimal point (period or comma) also is in a fixed position.All these are in fixed positions relative to the least significant digit of the amount. - Original Message - From:

Re: converting character to packed

2016-10-22 Thread Paul Gilmartin
On 2016-10-18, at 13:19, Tony Harminc wrote: > On 18 October 2016 at 02:34, 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

Rif: Re: converting character to packed

2016-10-19 Thread aldo . crosio
The first question I must ask is: what is the main language? the string to be converted is fixed or variable length? whether before or after the string? the currency above, following the string and, contiguous or separated? there is a need to vary parametrically decimal point or currency? In

Re: converting character to packed

2016-10-18 Thread Tony Harminc
On 18 October 2016 at 02:34, 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. This was the classic way to reverse a

Re: converting character to packed

2016-10-18 Thread Martin Truebner
Tony, >> here are inherent problems with using TR. The following are examples of valid input that has to be handled correctly. I am fully aware of all these- and i posted this before I posted my solution with the explicit stated assumption- this is a fields produced/checked/verified by a

Re: converting character to packed

2016-10-18 Thread Gary Gregory
: Tuesday, October 18, 2016 9:14 AM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: converting character to packed Michael, There are inherent problems with using TR. The following are examples of valid input that has to be handled correctly. I have used the "^" character to indic

Re: converting character to packed

2016-10-18 Thread Michael Stack
True, Tony - this solution was for a fixed format. At 09:14 AM 10/18/2016, you wrote: >Michael, > >There are inherent problems with using TR. The following are examples of valid >input that has to be handled correctly. I have used the "^" character to >indicate blanks. >$1,000.00^

Re: converting character to packed

2016-10-18 Thread Tony Thigpen
Michael, There are inherent problems with using TR. The following are examples of valid input that has to be handled correctly. I have used the "^" character to indicate blanks. $1,000.00^ 1,000.00^^ +1,000.00^ -1,000.00^ 1,000.00-^ ^^^1000.00

Re: converting character to packed

2016-10-18 Thread Michael Stack
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

Re: converting character to packed

2016-10-18 Thread Richard Kuebbing
That would be interesting code to see -Original Message- From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On Behalf Of robi...@dodo.com.au Sent: Tuesday, October 18, 2016 2:34 AM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: converting character to packed

Re: converting character to packed

2016-10-18 Thread Tony Thigpen
Martin, "the data input was manual into..." means that someone actually typed the data into a field. The data is unedited and may contain mistakes. The data can not be trusted. In this case, he needs a complete edit process either before are during the convert-to-packed process. Tony

Rif: Re: converting character to packed

2016-10-18 Thread aldo . crosio
The first question I must ask is: what is the main language? the string to be converted is fixed or variable length? whether before or after the string? the currency above, following the string and, contiguous or separated? there is a need to vary parametrically decimal point or currency?

Re: converting character to packed

2016-10-18 Thread Martin Truebner
Greg, >> the data input was manual into a 20 byte character field including $ >> signs, commas, and periods (ex. $13,532,908.01) i do not understand the word "manual" in this sentence (english is not my native language) - I assume a meaning of "prepared" "edited", "printed into", "manual

Re: converting character to packed

2016-10-18 Thread robin51
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

Re: converting character to packed

2016-10-17 Thread Gary Weinhold
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

Re: converting character to packed

2016-10-17 Thread robin51
Won't a TR followed by a PACK do this? - Original Message - From: "IBM Mainframe Assembler List" To: Cc: Sent:Mon, 17 Oct 2016 15:04:52 -0400 Subject:Re: converting character to packed since it was my original question and thanks for all of the suggestions, the data input was manual

Re: converting character to packed

2016-10-17 Thread Greg Gray
since it was my original question and thanks for all of the suggestions, the data input was manual into a 20 byte character field including $ signs, commas, and periods (ex. $13,532,908.01) and I am trying to convert to pack decimal for additional reporting on a zOS MVS machine.

Re: converting character to packed

2016-10-17 Thread Gary Weinhold
DS0H LAR8,1(,R8) next character JCT R9,IP010 IP030DS0H AGHI 15,X'C' sign STG 15,0(10) ...chris. -Original Message- From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSER V.UGA.EDU] On Behalf Of Ze'ev Atlas Sent: October-1

Re: converting character to packed

2016-10-14 Thread Steve Smith
SLLG 15,15,4 ready for next digit >> JCT 11,IP020 >> JIP030 too many chars >> >> IP020DS0H >> LAR8,1(,R8) next character >> JCT R9,IP010 >> >> IP030DS0H >> AGHI 15,X'C' sig

Re: converting character to packed

2016-10-14 Thread Tony Thigpen
Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On Behalf Of Ze'ev Atlas Sent: October-13-16 9:41 AM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: converting character to packed ClassicWe sould make a.macro out of it :)ZA Sent from Yahoo Mail on Android On Thu, Oct 13, 2016

Re: converting character to packed

2016-10-14 Thread Martin Truebner
None of the solutions presented here does any considering of commas or points. The input comes from carbon based units and they are known to need all kind of helps to get a number correct. So my solution would be to check for -1) just one decimal point and -2) commas at every forth position

Re: converting character to packed

2016-10-13 Thread Webster, Chris
nframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On Behalf Of Ze'ev Atlas Sent: October-13-16 9:41 AM To: ASSEMBLER-LIST@LISTSERV.UGA.EDU Subject: Re: converting character to packed ClassicWe sould make a.macro out of it  :)ZA Sent from Yahoo Mail on Android On Thu, Oct 13, 2016

Re: converting character to packed

2016-10-13 Thread Ze'ev Atlas
ClassicWe sould make a.macro out of it  :)ZA Sent from Yahoo Mail on Android On Thu, Oct 13, 2016 at 12:17 PM, Richard Rogers wrote: Just a stab, FWIW *      R8 ==> INCOMING FIELD *      R9  =  INCOMING FIELD LENGTH *      R10 ==> PL8 PACKED DECIMAL RESULT *       

Re: converting character to packed

2016-10-13 Thread Paul Gilmartin
On 2016-10-13, at 09:25, John P. Hartmann wrote: > You did not say that is what you want, but then I didn't notice which forum > you wrote to, so mea culpa. > > Anyhow, if your computer runs VM, you don't have to write assembler at all > (and if it runs MVS, make your requirement known to

Re: converting character to packed

2016-10-13 Thread Richard Rogers
Just a stab, FWIW * R8 ==> INCOMING FIELD * R9 = INCOMING FIELD LENGTH * R10 ==> PL8 PACKED DECIMAL RESULT *R11 = WORK - DIGIT COUNT *R12 ==> CL16 - WORK - SAVE DIGITS INCMPACK DS0H INCOMING PACK SRR11,R11 DIGIT COUNT LA

Re: converting character to packed

2016-10-13 Thread John P. Hartmann
You did not say that is what you want, but then I didn't notice which forum you wrote to, so mea culpa. Anyhow, if your computer runs VM, you don't have to write assembler at all (and if it runs MVS, make your requirement known to IBM). The instruction you want is PACK, but you must remove

Re: converting character to packed

2016-10-13 Thread John McKown
On Thu, Oct 13, 2016 at 9:42 AM, John P. Hartmann wrote: > Aw, c'm on! > > (Untested:) > > pipe ... | change /$// | change /,// | spec 1-* c2p 1 | ... > > Do you guys still do bubble sorts? ​That's not assembler code.​ -- Heisenberg may have been here. Unicode:

Re: converting character to packed

2016-10-13 Thread John P. Hartmann
Aw, c'm on! (Untested:) pipe ... | change /$// | change /,// | spec 1-* c2p 1 | ... Do you guys still do bubble sorts? On 10/13/2016 04:22 PM, Greg Gray wrote: I have character data in a field (ex. $13,501,298.01) and I need to remove the special characters and convert field from char to

Re: converting character to packed

2016-10-13 Thread Greg Gray
thanks Chuck, I will give that a try!!!

Re: converting character to packed

2016-10-13 Thread Hardee, Chuck
Given that the decimal position and commas are for you and me and not the computer, I would set a field to all "0" and then start a loop on the right of each field and if the character is >= "0" and <= "9", move it to the next position in the output field. Decrement each pointer based upon