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
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
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:
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
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
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
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
: 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
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^
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
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
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
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
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?
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
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
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
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
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.
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
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
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
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
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
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
*
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
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
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
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:
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
thanks Chuck, I will give that a try!!!
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
32 matches
Mail list logo