× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Agreed. I also think you'd take a performance hit from the regex. I
consider regex to be a valuable tool, but I wouldn't use it here.


date: Fri, 31 Jul 2020 10:24:35 -0400
from: Jon Paris <jon.paris@xxxxxxxxxxxxxx>
subject: Re: How to get the dollar value from this text string?

Still a lot less intuitive for the average RPGer that a %ScanR and %Subst
though.


On Jul 31, 2020, at 3:54 AM, Niels Liisberg <nli@xxxxxxxxxxxxxxxxx>
wrote:

Agreed Jon, I think I will challenge Birgita on that one:

Here i my one-liner solution: Remove any characters until the last blank,
Picup the number and remove the filal ~

**free

dcl-s instr varchar(256);

dcl-s dolar packed( 15: 2);



inStr = 'NTE*OTH*#OH- HANDLING CHARGES GSYE9R03/WHT/ / 4T/-
2.29~';

exec sql values rtrim(regexp_replace (:instr, '.* '),'~') into
:dolar;


return;






As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.