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



Greg,

Interestingly enough, RPG has no problem using a SQL index for native I/O.
You cannot generally use a SQL view in RPG though, unless you adopt embedded
SQL.  

Eric DeLong
Sally Beauty Company
MIS-Project Manager (BSG)
940-297-2863 or ext. 1863



-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx]On Behalf Of Fleming, Greg (ED)
Sent: Wednesday, December 14, 2005 9:50 AM
To: Midrange Systems Technical Discussion
Subject: RE: Usage of Indexes and its Effects on an RPG Program


If you are using READE, then I think your PF must be keyed, which is
just as good as having a logical file.  Check the source on your PF. 

As far as indexes go, if you are creating a new logical file, you have
to actually name that logical file on the F spec in your RPG program and
refer to it in your C specs.  

If you are talking about an SQL index, that's another matter with which
I'm not very familiar, but I think that Embedded SQL would probably pick
it up right away, but your regular RPG program won't use it at all.  It
only uses what you tell it to use. 

On a wider note, it sounds like you are trying to improve performance.
I've been preaching here a couple times in the last few weeks about the
hazards of using READE over a large data set, since it doesn't read from
a block of records in memory, but actually hits the file for every read.
If performance is an issue, much better to setLL on your key, then use
READ, and compare your records to your key fields with a few more lines
of code.  It's uglier, but it goes faster.



>-----Original Message-----
>From: midrange-l-bounces+gfleming=evergladesdirect.com@xxxxxxxxxxxx
>[mailto:midrange-l-bounces+gfleming=evergladesdirect.com@xxxxxxxxxxxx]
On
>Behalf Of Brian Piotrowski
>Sent: Wednesday, December 14, 2005 10:38 AM
>To: Midrange Systems Technical Discussion
>Subject: Usage of Indexes and its Effects on an RPG Program
>
>Hi All,
>
>
>
>I have a physical file that has 20 fields and contains over 2,000,000
>records.  In the current RPG program, it does a SETLL/READE on the data
>based on a key (which is the first five fields in the record).
However,
>the READE command does not have an associated logical file - it is
using
>the straight PF (this program was written before my time, and I suspect
>does not run as efficiently as it should).
>
>
>
>I went into the system (via Navigator) and added an index to this PF of
>the fields that are in the key.  Now my question: when a new index is
>created on a physical file, will an RPG program begin using it
>automatically, or does the program need to be made aware of the index?
>
>
>
>Thanks!
>
>
>Brian.
>
>
>
>-=-=-=-=-=-=-=-=-=-=-=-=-=-
>
>Brian Piotrowski
>
>Specialist - I.T.
>
>Simcoe Parts Service, Inc.
>
>PH: 705-435-7814
>
>FX: 705-435-6746
>
>-=-=-=-=-=-=-=-=-=-=-=-=-=-
>
>
>
>--
>This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
>To post a message email: MIDRANGE-L@xxxxxxxxxxxx
>To subscribe, unsubscribe, or change list options,
>visit: http://lists.midrange.com/mailman/listinfo/midrange-l
>or email: MIDRANGE-L-request@xxxxxxxxxxxx
>Before posting, please take a moment to review the archives
>at http://archive.midrange.com/midrange-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.