A regular expression using the DB2 RegExp_SubStr function?

Numbers: ( Capture Group 1 )
values ( regexp_substr('100 QT', '(\d+)\s?([a-z]+)',1,1,'i',1))

letters: ( Capture Group 2 )
values ( regexp_substr('100 QT', '(\d+)\s?([a-z]+)',1,1,'i',2))



On Thu, 11 Oct 2018 at 00:47, Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx>
wrote:

A simple way to do that is to use the %CHECK BIF to find the first
non-numeric character (search for numbers 0-9, period, comma, blank...
maybe also dash) then use %SUBST to separate them. Maybe also use %TRIM
if you don't want leading/trailing spaces.

Good luck

--
Scott Klement
http://www.scottklement.com



On 10/10/18 5:04 PM, Thomas Burrows wrote:
I want to put the ALPHA part in one field and the number part in another
field. The end result will be pushed back into an EXCEL file.

On Wed, Oct 10, 2018 at 4:36 PM Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx

wrote:

Solution to what? What problem are you trying to solve?


On 10/10/2018 4:13 PM, Thomas Burrows wrote:
If one has a field with values like
10QT
100QT
100 QT

The number part can be any length - okay something reasonable like less
than 10K.

Can and/or cannot have a space in the field.

Then the start of alpha characters. Only the American 26 character
alphabet. Upper or lower case.

Can I solve the problem of taking the numeric part and putting into
another
field by itself AND then putting the character part into an additional
field. At the moment I do not think we need to convert the CASE on the
alpha part.

=================================================

Or would this problem better be solved in COBOL using the INSPECT
statement?
Open to sending a Home Depot Card of a reasonable amount of $$$ "say
$40"
to anyone who can give me a quick solution.

The COBOL Kid - Actually Thomas
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD

--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2020 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].