|
On Wed, 11 Apr 2001 Gary.Brown@appliedchemicals.com wrote:
>
> I have a logical over my invoices file, the KLIST for it is
>
> KEYINV KLIST
> KFLD CUSNO
> KFLD CSITE
> KFLD INVDT
>
> My question is how can I retrieve all the invoices for a particular date
> regardless of customer or site
>
Basically, you have 4 options:
1) The the WHOLE file in RPG, and ignore anything that doesn't match
the date you specified. (Not a method I would recommend)
2) Run an OPNQRYF on the file, and read that. Note that this doesn't
actually require a CL program, you could run the OPNQRYF directly
from your RPG program.
3) Use SQL. This would basically yield the same result as the OPNQRYF,
but SQL is a much more standard method of accessing databases than
OPNQRYF.
4) Use a logical file.
Each method has its pros and cons. Unless the file is tiny, I wouldn't
give much thought to option #1. If saving the space, etc of a logical
file is more important than instant response time, I'd use option #2.
If speed is more important I'd use option #4.
Option #3 may be a better choice, but I wouldn't use it because I don't
own the SQL licensed program. :) So I use OPNQRYF instead.
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.