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



Kurt,

As it has been a while, this works as a two column table. one column
(field) for the lookup, the other for the second value.

So you only load tho fields (refernced as the table columns) from the file
into the programme, as you want it.

Regards,
Carel Teijgeler


*********** REPLY SEPARATOR ***********

On 10-11-2011 at 16:13 Kurt Anderson wrote:

I know we have programs that use that. But it has to then load the
entire table, when I only want two fields.
Honestly I'm not concerned about the speed here.

-Kurt

-----Original Message-----
From: rpg400-l-bounces+kurt.anderson=customcall.com@xxxxxxxxxxxx
[mailto:rpg400-l-bounces+kurt.anderson=customcall.com@xxxxxxxxxxxx] On
Behalf Of Carel Teijgeler
Sent: Thursday, November 10, 2011 3:28 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: RE: %lookup on a Data Structure Array

Kurt,

As you already replied in another mail indicating you did, but have you
looked at defining the file i n question as a Table file? (I know, an old
technique).

In stead of typing an P for Primary or F for fully procedural you type in
T. In the D-specs you have to link the file to the defined internal table.
IIRC, the columns in the internal table, should be adjacent fields from
the file.

I just used this technique once, more than a decade ago, but the programme
ran very fast. So my memory is very rusty on this.

Regards,
Carel Teijgeler

*********** REPLY SEPARATOR ***********

On 10-11-2011 at 13:26 Kurt Anderson wrote:

I'm aware of SETOBJACC, however I don't want this entire file in
memory,
only two fields. Also, each of our clients has their own version of the
file, so keeping it in memory doesn't seem like a viable option
regardless.

I do need to retrieve a value, so I can't simply check for the
existence
of the record.

I am aware of a potential performance hit of loading the array all at
once. These are all batch jobs, and at most there would be 33k records
(I'd define the array to be 50k to allow for growth), which is going to
load in seconds - so from a batch perspective, extra seconds once is ok.

However this discussion has given me the idea (or maybe someone
actually
mentioned this and I took it the wrong way, yet lead me to the same
conclusion) that I could check the array. If the customer isn't there,
then go to the file and get the value I need plus add the customer/value
to the array. So in the case of having 33k customers, maybe my job of
running 30 million records only uses 15k of those customers, then I've
made the array smaller so the lookups would be quicker.

This is all nice, however I think I need to enter a RFE for the RPG
team
to further enhance data structure array capability.

In regard to User Indexes, I'm not sure where at the point of trade-off
occurs. Like - when is it better to use a User Index than an array? I'm
sure there's presentations on that out there (and likely even on
conference CDs we have).


--
This is the RPG programming on the IBM i / System i (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.

--
This is the RPG programming on the IBM i / System i (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.



-----
Geen virus gevonden in dit bericht.
Gecontroleerd door AVG - www.avg.com
Versie: 10.0.1382 / Virusdatabase: 2092/4008 - datum van uitgifte:
11/10/11



-----
Geen virus gevonden in dit bericht.
Gecontroleerd door AVG - www.avg.com
Versie: 10.0.1382 / Virusdatabase: 2092/4008 - datum van uitgifte:
11/10/11




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.