|
At first glance, it appears to me that you have gone the overkill route. The KISS principle would seem to dictate that you want to do one OVRDBF, OPNQRYF, CPYFRMQRYF, DLTOVR cycle for each file in a loop. You'd use a &FileName variable and set it at the top of the loop; probably a little more coding to effect a pseudo-array in your CL, but not that difficult. Before entering the loop, create the output file or ensure that it is empty, then use MBROPT(*ADD) in your CPYFRMQRYF. Dan Bale IT - AS/400 Handleman Company 248-362-4400 Ext. 4952 D.Bale@Handleman.com Quiquid latine dictum sit altum viditur. (Whatever is said in Latin seems profound.) -------------------------- Original Message -------------------------- Hi, I'm trying to write an OPNQRYF that will apply the same selection criteria to 10 physical files, all with the same format. i.e. Files: Tax00, Tax99, Tax98, Tax97........ I want to select all the recs for all of these files such that RefDte *NE "0001-01-01". Anyone have any sample code that accomplishes this? When I do it, the CL loops..... And just keeps writing the same record, over and over, and over... TIA, Dave PS Here's the actual code: PGM OVRDBF FILE(REPOPCITY0) OVRSCOPE(*JOB) SHARE(*YES) OVRDBF FILE(REPOPCITY9) OVRSCOPE(*JOB) SHARE(*YES) OVRDBF FILE(REPOPCITY8) OVRSCOPE(*JOB) SHARE(*YES) OVRDBF FILE(REPOPCOUN0) OVRSCOPE(*JOB) SHARE(*YES) OVRDBF FILE(REPOPCOUN9) OVRSCOPE(*JOB) SHARE(*YES) OVRDBF FILE(REPOPCOUN8) OVRSCOPE(*JOB) SHARE(*YES) OPNQRYF FILE((RESLIB/REPOPCITY0) (RESLIB/REPOPCITY9) + (RESLIB/REPOPCITY8) (RESLIB/REPOPCOUN0) + (RESLIB/REPOPCOUN9) (RESLIB/REPOPCOUN8)) + FORMAT(RESLIB/REPOPCITY0) QRYSLT('REFDATE + *NE "0001-01-01"') MAPFLD((WARD '1/ward') + (PROPNO '1/propno') (QTR '1/qtr') + (TAXYEAR '1/taxyear') (OWNNAME + '1/ownname') (OWNADDR1 '1/ownaddr1') + (OWNADDR2 '1/ownaddr2') (OWNADDR3 + '1/ownaddr3') (ADDR '1/addr') (AMTOWED + '1/amtowed') (AMTPAID '1/amtpaid') + (PAIDDATE '1/paiddate') (CLAIM# + '1/claim#') (LTR#1DATE '1/ltr#1date') + (LTR#2DATE '1/ltr#2date') (ADVDATE + '1/advdate') (REFDATE '1/refdate') + (AMTREF '1/amtref') (STATUS '1/status') + (AMTOVRPD '1/amtovrpd') (COMMENT1 + '1/comment1') (COMMENT2 '1/comment2') + (FILLER '1/filler')) CPYFRMQRYF FROMOPNID(REPOPCITY0) + TOFILE(TSTLIB/TAXOPALL) MBROPT(*REPLACE) + CRTFILE(*YES) +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-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.