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



--
Rick,

First of all, you do not need to map the fields to join those files
Secondly, doing it this way you are not capable of using fields from the
SELCOPY file, as they are not in the defined FORMAT.

In OPNQRYF the first file listed is the file from which joining starts and
should be used in a programme. This can be overridden by using a dummy PF
on the FORMAT keyword. In this dummy PF you list all the fields
required  within the query/programme.
As you are not allowed to create new objects you cannot use that dummy PF
on that keyword.
And without permission to change the programme you have to use the first
version of your query; otherwise you have to define SELCOPY in the F-specs.

I assume you all know this, but nevertheless.

You may try to look at the OPTIMIZE keyword, but with that many records it
may not be helpfull.

If possible, create the dummy PF.

Regards,
Carel Teijgeler.

>OVRDBF    FILE(FILE1) TOFILE(MYLIB/FILE1) SHARE(*YES)
>OVRDBF     FILE(SELCOPY) TOFILE(QTEMP/SELCOPY) SHARE(*YES)
>
>OPNQRYF    FILE((MYLIB/FILE1) (QTEMP/SELCOPY)) +
>              FORMAT(MYLIB/FILE1 *ONLY) +
>              KEYFLD((*MAPFLD/F1FLD1) (*MAPFLD/F1FLD2)) +
>              JFLD((*MAPFLD/F1FLD1 *MAPFLD/F2FLD1 *EQ)  +
>                   (*MAPFLD/F1FLD2 *MAPFLD/F2FLD2 *EQ)) +
>              MAPFLD((F1FLD1    'FILE1/FLD1    ')  +
>                     (F1FLD2    'FILE1/FLD2    ')  +
>                     (F2FLD1    'SELCOPY/FLD1  ')  +
>                     (F2FLD2    'SELCOPY/FLD2  '))  +
>              OPNID(FILE1)
>
>I'm trying to select certain records from FILE1 (over 1M records) by
>joining it to SELCOPY (only a reletive few) - outputing to the format of
>FILE1, so my RPG program can read it.  the override works nicely to let the
>RPG see the results of the query.  The query runs fine but is VERY slow.
>
>I tried reversing the order of the files in the join:
>
>OPNQRYF    FILE((QTEMP/SELCOPY) (MYLIB/FILE1) ) + ....
>
>thinking that because it had only a few records it might build the access
>path more efficiently and run faster.
>
>the query still runs, and it appears that it builds the access path more
>quickly than the other way around.  but now I've lost the opnqryf/rpg
>connection.  the rpg is reading the the whole of FILE1, not the subsetted
>records from the opnqryf, even though the override is still in place, and
>i've named my OPNID the same.
>
>Rick
--




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.