|
True, and I said that in my earlier reply. Rob Berendt -- Group Dekko Services, LLC Dept 01.073 PO Box 2000 Dock 108 6928N 400E Kendallville, IN 46755 http://www.dekko.com Al Barsa <barsa@xxxxxxxxxxxxxxxxxxx> Sent by: midrange-l-bounces@xxxxxxxxxxxx 03/04/2005 04:17 PM Please respond to Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx> To Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx> cc Subject Re: Logical File or OPNQRYF or any other way ? But if you always know the keys for the file, and underlying LF would certainly help run time performance. Al Al Barsa, Jr. Barsa Consulting Group, LLC 400>390 "i" comes before "p", "x" and "z" e gads Our system's had more names than Elizabeth Taylor! 914-251-1234 914-251-9406 fax http://www.barsaconsulting.com http://www.taatool.com http://www.as400connection.com rob@xxxxxxxxx Sent by: midrange-l-bounce To s@xxxxxxxxxxxx Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx> 03/04/2005 12:06 cc PM Subject Re: Logical File or OPNQRYF or Please respond to anyother way ? Midrange Systems Technical Discussion <midrange-l@midra nge.com> The imbedded SQL got better in V5R3. Rob Berendt -- Group Dekko Services, LLC Dept 01.073 PO Box 2000 Dock 108 6928N 400E Kendallville, IN 46755 http://www.dekko.com Ken Sims <mdrg5003@xxxxxxxxx> Sent by: midrange-l-bounces@xxxxxxxxxxxx 03/04/2005 11:36 AM Please respond to Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx> To midrange-l@xxxxxxxxxxxx cc Subject Re: Logical File or OPNQRYF or anyother way ? Hi Malini - >I have a physical file which has millions of records, and this physical >file gets updated quite frequently by various programs in the application. > >I have to develop 2 programs pertaining to an enhancement request. > >Program 1 > >Needs to read the file selectively based on two fields of the physical >file , perform calculations on the selected records and update them. There >is no existing logical file on the physical with these 2 fields as a key > >Program 2 > >Needs to read (only)the file selectively. File is opened in input mode only. > >Which is the more efficient method in each case - creating a logical file >with the 2 fields as key or using an openquery with select on the 2 fields >before each program is called. Any other efficient way ? The most efficient way is to have a logical file. If either of the programs is interactive, or if either program is going to be run frequently, definitely make a logical file. If both are going to run in batch and not very often (like a month-end program), then an OPNQRYF with record selection would probably be acceptable. >Also :- What are the scenarios where a logical file is preferred over an >open query file and vice-versa ? My response above pretty covers that. Additionally, even for an infrequent batch program, if you need to do keyed operations (rather than just processing all of the selected records sequentially), the logical file is better. In that case the logical file could be MAINT(*REBLD) so that the access path would be built when the file is opened. SQL is also an option for batch programs, but personally I find SQL to be a real PITA for many reasons, not the least of which is the poor integration of SQL into the RPG compilers (not the fault of the compiler folks). -- Ken http://www.ke9nr.net/ Opinions expressed are my own and do not necessarily represent the views of my employer or anyone in their right mind. -- This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l. -- This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l. -- This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.
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.