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



Dan

This is a great opportunity to start to use SQL for this

- you get the chance that the newer engine will be used, with typically better performance (LIKE predicates, for example, force the use of the older engine, at least to V5R4, and IIRC, V6R1)
- you don't have to deal with overrides at all (unless you are dealing with multiple members)
- you have much more control and flexibility than OPNQRYF gives you - and ultimately much easier to understand
- you can build the SQL SELECT statement on the fly and get the sort you need

Since you are talking about a report, you might consider Query Management objects and techniques - queries and forms. You can use substitution variables even for the ordering in the query and get very nice reports using forms. STRQM is the command to get you there.

If you use SQL in your RPG, you might be able to have a single statement that will give you option for the ordering - it involves a CASE clause to select which column(s) to sort on, based on the value of something or a set of conditions. This could even be handled as embedded, giving you better performance.

HTH
Vern

Dan Rasch wrote:
I am trying to use OPNQRYF to choose between four user options to order a report.

I run the OVRDBF, and it looks fine:


OVRDBF FILE(POMST) SHARE(*YES)


Then, I run one of the four OVRDBF's. Here's one example:


OPNQRYF FILE(POMST) OPTION(*ALL) +

QRYSLT('(POMSTS = ''0'') *AND (POMCPY = 01 )') +

KEYFLD((POMLOC) (POMVNM) (POMVCD) (POMPON)) +

OPTIMIZE(*FIRSTIO) SEQONLY(*YES 10)


It runs with no error, and I am expecting to read the file by:

location, vendor name, vendor code, and PO#
(as coded). What I get is by PO#.


Any ideas?


Thanks,

- Dan

_________________________________________________________________
Internet Explorer 8 – Get your Hotmail Accelerated. Download free!
http://clk.atdmt.com/MRT/go/141323790/direct/01/

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.