If delimited, I believe there is a drop-in string splitting UDTF already written by somebody.
If the UDTF is invoked as below, then it makes it trivial to extract the elements:
Select * from table(SplitStr(<string>, <delimiter>)) as t
Regards,
Anoop
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of John Yeung
Sent: 01 September 2016 02:49
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: SQL Where In
On Wed, Aug 31, 2016 at 2:12 PM, (WalzCraft) Jerry Forss <JForss@xxxxxxxxxxxxx> wrote:
This would be an issue for what I am doing.
Some of the values will be MLMD, MLDM and MLD.
So scanning for a value of MLD may give a false positive.
It wouldn't, if you took the appropriate precautions for the format of the data.
The example you started with was minimal, so I couldn't tell if it was space-delimited or fixed-width.
If fixed-width, then you would want to divide the result of your scan by the element size, and you only have a match if the remainder is 1.
If delimited (by anything, including spaces), then you would first of all want to ensure you have a delimiter at the beginning of every field (so one extra one at the beginning) or at the end (so one extra one at the end). Then include the delimiter in your scan.
So, scanning is still doable, but how convenient it is depends on how the data in the big string is formatted.
John Y.
--
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:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Visit our website at
http://www.ubs.com
This message contains confidential information and is intended only
for the individual named. If you are not the named addressee you
should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.
E-mails are not encrypted and cannot be guaranteed to be secure or
error-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete, or contain viruses. The sender
therefore does not accept liability for any errors or omissions in the
contents of this message which arise as a result of e-mail transmission.
If verification is required please request a hard-copy version. This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities
or related financial instruments.
UBS reserves the right to retain all messages. Messages are protected
and accessed only in legally justified cases.
As an Amazon Associate we earn from qualifying purchases.