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



Hi Dave,

I don't see why an SQL statement wouldn't work?

Is your concern that you don't want to change the RPG program? That's about the only area where OPNQRYF has any advantage over SQL. OPNQRYF can be completely transparent to the RPG program, whereas to do SQL "right", you'd have to rewrite the RPG program to read the records via SQL instead of native I/O.

Of course, one workaround might be to use SQL to write the data to a temp file in QTEMP, and then make the RPG read that temp file. But, that less elegant than OPNQRYF.

To me, SQL should be used when you want an (arguably 'better') alternative to native I/O. Whereas, OPNQRYF is used to supplement native I/O. If I were rewriting the RPG program, I'd definitely use SQL instead of native I/O. But, if I'm not rewriting the RPG, and just rewriting the front-end, SQL seems like a kludge.

Hope that makes sense.

On 2/20/2012 4:46 AM, Dave wrote:
I have an rpg called by a clp. It just reads a file and prints a report.
The file existed in several different libraries, now all the files are
fusioned to make one big one with a product code field added to be able to
distinguish between the different records. I will probably just add an
opnqryf to select the records with the right product code. I don't think I
could easily use SQL here, but am I wrong?


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.