|
Gary, The following code will let you select on your INVDT via SQL. 0001.00 **================================================================ 0002.00 d#INPUT E DS extname(FILENAME) prefix(sql_) 0003.00 **================================================================ 0003.00 **>>>>>>>>>>>>>>>>>>>>>>>>define your beg_INVDT and end_INVDT here 0004.00 c/exec sql 0005.00 c+ declare C1 cursor for 0006.00 c+ select * 0007.00 c+ from FILENAME 0008.00 c+ where INVDT between :beg_INVDT and :end_INVDT 0009.00 c/end-exec 0010.00 0011.00 c/exec sql 0012.00 c+ open C1 0013.00 c/end-exec 0014.00 0015.00 c/exec sql 0016.00 c+ fetch C1 into :#INPUT 0017.00 c/end-exec 0018.00 0019.00 c IF SQLCOD = 0 0020.00 c DOW SQLCOD = 0 0021.00 ** 0022.00 **>>>>>>>>>>>>>>>>>>>>>>>>program logic here 0023.00 ** 0024.00 c/exec sql 0025.00 c+ fetch C1 into :#INPUT 0026.00 c/end-exec 0027.00 c ENDDO 0028.00 c ENDIF 0029.00 c/exec sql 0030.00 c+ close C1 0031.00 c/end-exec 0032.00 c eval *INLR = *ON 0033.00 **================================================================ Diane -----Original Message----- From: Gary.Brown@appliedchemicals.com [mailto:Gary.Brown@appliedchemicals.com] Sent: Tuesday, April 10, 2001 10:05 PM To: RPG400-L@midrange.com Subject: KLIST question 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 I know I could simply create another logical, but it seems a little bit wasteful to create a logical for just one report that will be run once a day. I also know that I could do a OPNQRYF in my CL first and limit the records that way and then read all records in my RPG/400. Just wondering if there is a way to do it from within RPG/400. Thanks, Gary. +--- | 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 +--- +--- | 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-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.