× 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 think I was one of the ones who suggested a user space. The reason I did that 
was to minimize the number of IFS I-Os that had to be done. A user space 
provides a bigger buffer that is available from an RPG data structure. You 
could ALLOC the memory, but a user space is less of a worry (maybe I shouldn't 
worry so much and have just worked with too many PC C-programmers who lose 
sleep over memory leaks?). 

My impression/surmise is that doing a single or (if the IFS file is very big 
and won't fit into a max-size user space entirely) a few I-Os into the user 
space would be quicker than doing a large number of small reads.

I've not tried this recently, so I'm going on a vague recollection that this 
was a conclusion I came to in the past (but it seems to make sense). 

I'll try to find time to give my ideas on how to scan the user space later. I 
won't have a chance to test this out this morning, but I'm wondering whether 
the C-function sscanf might be useful to you. I think prototyping this in RPG 
could be a challenge but I'm sure somebody on this board is up to it! :-)

Pete
----- Original Message ----- 
From: "Scott Klement" <klemscot@xxxxxxxxxxxx>
To: "RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx>
Sent: Tuesday, June 24, 2003 5:39 AM
Subject: Re: scanning user space


> 
> On Mon, 23 Jun 2003, Richard B Baird wrote:
> >
> > But if you don't think i'm not going to gain anything by loading the whole
> > thing at once to a userspace and scanning it from there, then i'll out bail
> > on this one.
> >
> 
> I don't think you'll gain anything by putting it in a user space, but I
> don't know for sure.   I've certainly never tried it!  I'd be interested
> to see how it turns out.
> 
> It seems likely to me that what you'd be doing, when you copy 2million
> records from a stream file to a user space, is just copying megabytes of
> data (which may not even fit, since user spaces are limited to 16 mb!) and
> then scanning it in the same manner that you would otherwise be scanning 
> it....
> 
> I guess it seems more efficient to me to deal with it in smaller pieces!
> 
> But, on the other hand, that could be the Unix programmer in me talking...
> OS/400 can be a strange animal.   I know that the system is better at
> dealing with user spaces than stream files (despite the obvious logic that
> they're basically the same thing) and it's likely that being able to
> directly scan the user space would save you a bit of time in parsing.
> The question is, would it save you as much time as you're sacrificing by
> copying over 2 million records that you wouldn't otherwise have to copy?
> 
> It's an interesting question, yes?
> _______________________________________________
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
> To post a message email: RPG400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: RPG400-L-request@xxxxxxxxxxxx
> 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-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.