Nice option, to have the extra parameters.

*Regards*

*Vern Hamberg*

IBM Champion 2025 <cid:part1.lU1HC0l9.TK417BOo@centurylink.net> CAAC (COMMON Americas Advisory Council) IBM Influencer 2023


On 2/3/2026 9:27 AM, Marco Facchinetti wrote:
Usually I prefer LOCATE_IN_STRING, adds:
- Scan reverse
- A specific instance of the searched string

HTH
--
Marco Facchinetti

Mr S.r.l.

Tel. 035 962885
Cel. 393 9620498

Skype: facchinettimarco


Il giorno mar 3 feb 2026 alle ore 15:30 Vern Hamberg via MIDRANGE-L <
midrange-l@xxxxxxxxxxxxxxxxxx> ha scritto:

Hi Jim

I sometimes use the POSSTR function to get where a string is, along with
adding to the returned value to get the end or start of the next thing.

Now if values and all are broken apart and on different rows, maybe you
could put them back together with LISTAGG. That function does need
something on each row to identify what should go together.

*Regards*

*Vern Hamberg*

IBM Champion 2025<cid:part1.U4VznBDg.CfM1fKGm@centurylink.net> CAAC
(COMMON Americas Advisory Council) IBM Influencer 2023


On 2/3/2026 8:11 AM, Jim Franz wrote:
I'm trying to select the value from a log file which holds part of large
json rows, but the json incomplete and not readable so the "status" never
in same position. I need the value of status.or even the whole string
"status":"Paid"
(scan and substring may be wrong description)
sample data
"status":"Paid","allow
],"status":"Declined",

I can picture this in RPGLE but trying to improve my sql...
Found solutions online but not DB2.

Jim Franz
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email:MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:https://lists.midrange.com/mailman/listinfo/midrange-l
or email:MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
athttps://archive.midrange.com/midrange-l.

Please contactsupport@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

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