You can use 2 commands - RTVQMQRY and RTVQMFORM - to convert Query/400 queries.

You might run the ANZQRY command first. This will notify you of possible issues, many related to presentation and not to data.

Break levels are part of presentation, and that is the QMFORM piece.

Also, ordering may effect your results - and there is nothing to guarantee order without specific instructions with an ORDER BY or the equivalent in Query/400.

Anyhow, RTVQM* commands generate source that contains what is needed to create the objects (QMQRY and QMFORM).

Are all the join types- are they type 1? Then the SELECT statement should be fine at all releases of the OS.

If some are other than type 1, you need to put on a PTF - there was a long-standing bug in the RTVQMQRY that it made a SELECT with only type 1 joins, no matter what.

Here are the PTFs from v5r4 - the earliest release for which they are available -


I have given a presentation on QM stuff at COMMON and elsewhere, contact me off-list if you want a copy - also a lab.

FYI - Query/400 queries combine data retrieval and presentation in one object - QM separates them - QMQRY is data retrieveal (SELECT statement) and QMFORM is presentation - level breaks, column headings, all that stuff.

QMQRYs can be used for almost any SQL statement - not just SELECTs - that's a topic for another day, of course.


On 12/26/2013 4:59 PM, Hoteltravelfundotcom wrote:
HI I have been unable to duplicate this query.
It uses 5 files it matches from the orderhistory file to customer, and
shipping, invoice history and address files.

has some record selects and sorting, no problems so far. Does totals on qty
shipped and $shipped.

Does break levels on 9 fields. this is the part I cannot translate. then
puts the data to a temp file.

I am not getting the same number of records no matter what. am sure the
issue is how to code this Break in SQL.

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