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



I had some big level break programs I didn't want to change. I used a
"special file" to use sql to return the records to the main program. works
great for me. Only needed to change 1 line in the program, the file spec,
and build a little rpg program to do what the opnqryf (or gsort or #gsort)
did before.

------------------------------

message: 2
date: Mon, 20 Feb 2012 14:01:11 -0600
from: Scott Klement <midrange-l@xxxxxxxxxxxxxxxx>
subject: Re: Must I use OPNQRYF

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.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.