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



Keith,

This doesn't sound right.  Can you post code?  I just wrote a little test
program and have no problem using scan with large fields.  The return value
from %Scan is UNsigned integer.  Make sure it's defined as 5U 0 or 10U 0.

-----Original Message-----
From: keith_mccully@wunderman.co.uk
[mailto:keith_mccully@wunderman.co.uk]
Sent: Wednesday, November 13, 2002 8:05 AM
To: RPG400-L@midrange.com
Subject: %scan out of range error


This is a multipart message in MIME format.
--
[ Picked text/plain from multipart/alternative ]
I am using %scan to split out individual fields from a CSV file:

EVAL      pos = %scan(sep: input : start)
sep = ','  , input is the CSV record and start pos increases as the fields
are stepped through.

 However, I got an error:  'Length or start position is out of  range for
the string operation'. Debug showed that there is a 256 byte limit on the
scan string length although the IBM ILE RPG documentation does not mention
this! I'm on v4r5 and can create character data up to 32,767 so why is the
scan restricted to the RPG3 char max of 256? A scan of 32,767 is extreme
but my input CSV record had a max of 480 which seems very reasonable.  Has
the limit been lifted for v5?

I got by this with a messy workaround of splitting the input into two and
scanning each bit separately. I rejected the QCLSCAN API which has a max
of 999 because of the call overhead.

Keith
_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.