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



On Wed, Aug 30, 2017 at 10:49 AM, Jeff Young <jyoung0950@xxxxxxxxx> wrote:
With the extra double quotes in the field, how can I determine the correct
position for the end of the field?

Well, honestly, I think the *best* way is to use a proper, prebuilt
CSV parser. My favorite is of course the one that comes with Python.

But I believe the quickest way home in RPG is to first %SCANRPL all
occurrences of adjacent double-quotes with some single replacement
character that is guaranteed not to be in the data.

If you truly are just interested in the total length of the final
data, you then just look for start and end quotes normally and get
your number of bytes that way.

If you are reading in the data, then read in the modified string and
do %SCANRPL at the end to replace the replacement character with
double-quote.

This is of course assuming that CPYFRMIMPF doesn't properly handle
embedded quotes. I don't remember off the top of my head if it does.

John Y.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.