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