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



On 20-Feb-2012 02:46 , 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.

Difficult to beat the simplicity of inserting an OPNQRYF to perform the necessary selection via QRYSLT, and share that query ODP with the unchanged RPG program in that very simple scenario. While an effectively identical CPYF could be just about as easy, that involves making a temporary copy of the data which is generally undesirable.

Some other fairly simple alternatives would be if the report both can be generated and replaced easily by a utility having eliminated any HLL beyond the CLP, or if collation was moot such that a dynamically created VIEW could be used instead of the dynamic query ODP, or if the RPG were changed to choose the specific format of a MFLF which defines each of the hard-coded product code selection [with DYNSLT to have just one keyed AccPth]. The latter could be accomplished similarly by separate single-format logical files, and any LF could be created dynamically from source into QTEMP or duplicated from a /model/ file to persist only during run-time if the permanent logical files were not desirable.

I don't think I could easily use SQL here, but am I wrong?

Almost surely the SQL can easily be used in such a scenario... however, that the question was even asked, seems to imply not so simply or easily for the OP. To be clear, there is no OPNSQLF :-( While this scenario would probably make for a good SQL learning experience for a beginner, if there is any urgency in getting the change implemented, then the very simple OPNQRYF might be the best first-approach to resolve.

Regards, Chuck

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.