× 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.



I'm going to suggest that this approach could give unexpected bad results - XML documents are typically in UTF-8, and what looks like control characters might not be. I say that as a kind of dogmatic assertion, it's possible the UTF-8 design makes that stuff not happen, but it might.

Better to actually get the UTF-8 interpreted as what it is instead of a stabbing guess at what can be ignored.

JMNSHO
Vern

On 2/24/2021 2:15 PM, Alan Shore via MIDRANGE-L wrote:
Hi Carel
I know you are looking at a Clob – but take a look at this web page
https://www.rpgpgm.com/2016/03/a-better-way-to-read-file-in-ifs-with.html
Could reading it via RPG help?

Alan Shore
Solutions Architect
IT Supply Chain Execution

[cid:image001.png@01D70ABF.DDD31AF0]

60 Orville Drive
Bohemia, NY 11716
Phone [O] : (631) 200-5019
Phone [C] : (631) 880-8640
E-mail : ASHORE@xxxxxxxxxxxxxxxxxxxx

‘If you're going through hell, keep going.’
Winston Churchill

From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of Carel
Sent: Wednesday, February 24, 2021 3:10 PM
To: midrange-l@xxxxxxxxxxxxxxxxxx
Subject: [EXTERNAL] Error with XML-INTO caused by non-printable characters

Runnin on V7.1

We receive from a SAP environment xml documents which are stored as a
CLOB in a PF on our system.

To process those xml documents we extract those documetns from that
file, store it on the IFS and then read the IFS file in with XML-INTO.

Some of those xml documents crash on the XML-INTO opcode. It appears
those xml documents contain non-printable charaters (less than x'40')

So, we have to remove those non-printable charaters.

I looked at QSH -tr command, but could not gget it to work.

Another option is using SQL when retrieving the CLOB from the PF before
writing to the IFS.
Itried the following syntax:

exec sql
select REPLACE(CLOB_in_PF, x'0102 ... 3E3F', '') into :SQLCLOB_field
from Our_PF ; (thus all hex values with the exception of NULL).

This doesnot work.

Question:
How can we remove those non-printable characters from an xml document
stored in our PF?

TIA

Kind regards,
Carel Teijgeler




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

Please contact support@xxxxxxxxxxxxxxxxxxxx<mailto:support@xxxxxxxxxxxxxxxxxxxx> for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com<https://amazon.midrange.com>



The Nature’s Bounty Co. is now The Bountiful Company! Our email address will be changing from @nbty.com to @bountifulcompany.com. Please update your email address book so that important communications are not interrupted.


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-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.