|
This is exactly right. I see people who are trying to simulate objects with RPG by creating GetCustName, GetCustAddr, GetCustZipCode procedures. Then in the procs, the code basically chains out to the file every time one of these procedures is called. I suppose if performance isn't an issue, this is an interesting experiment. If you must do this (and I don't agree with it) then at least save the previously retrieved record's key value and compare it to subsequent requests. If it is the same, simply return the data from the existing input buffer rather than re-chain out to the file. Better yet, use embedded SQL and simply SELECT the record and fields you want. Again, it is preferred to create components that do a business task and return; getting the customer's address is not a business task, but rather a database task. -Bob Cozzi www.RPGxTools.com RPG xTools - Enjoy programming again. -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Wilt, Charles Sent: Friday, September 02, 2005 8:20 AM To: RPG programming on the AS400 / iSeries Subject: RE: Subprocedure Question Joel, You wouldn't want 11 sets of read/chain/setll/setgt/update/write procedures. In fact, you don't really want even one. You shouldn't simply be replacing RPG I/O opcodes with calls to a procedure. You're not really gaining much by doing that. Instead, look at the business logic behind the use of the logicals. PARTMASTER_LookupUsingCustomerPartNumber() PARTMASTER_GetAlphabeticalList() PARTMASTER_GetNextPartByVendor() ORDERHEADER_GetNextOrderToProcess() HTH, Charles Wilt -- iSeries Systems Administrator / Developer Mitsubishi Electric Automotive America ph: 513-573-4343 fax: 513-398-1121 > -----Original Message----- > From: rpg400-l-bounces@xxxxxxxxxxxx > [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Joel Fritz > Sent: Thursday, September 01, 2005 6:45 PM > To: RPG programming on the AS400 / iSeries > Subject: RE: Subprocedure Question > > > > I'm thinking of a file with ten logical views and imagine implementing > random I/0 and selective updates. > > RPG is just not designed to make this easy, even with a generator API. > > > <><><>-----Original Message----- > <><><>From: rpg400-l-bounces@xxxxxxxxxxxx > <><><>[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of > Scott Klement > <><><>Sent: Thursday, September 01, 2005 11:39 AM > <><><>To: RPG programming on the AS400 / iSeries > <><><>Subject: RE: Subprocedure Question > <><><> > <<<<<<<<<<<<<<<<<<<<<< Immense Snip >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > <><><> > <><><>Though, frankly, I think you're creating a nightmare for > <><><>yourself by doing > <><><>things this way. Don't "echo' the RPG CHAIN, READ, > <><><>WRITE, etc opcodes, it > <><><>gains you very little! Instead, write a "Business Model" > <><><>service program, > <><><>and keep with the MVC design. > <><><>-- > <><><>This is the RPG programming on the AS400 / iSeries > <><><>(RPG400-L) mailing list > <><><>To post a message email: RPG400-L@xxxxxxxxxxxx > <><><>To subscribe, unsubscribe, or change list options, > <><><>visit: http://lists.midrange.com/mailman/listinfo/rpg400-l > <><><>or email: RPG400-L-request@xxxxxxxxxxxx > <><><>Before posting, please take a moment to review the archives > <><><>at http://archive.midrange.com/rpg400-l. > <><><> > <><><> > > ***************************** > NOTICE: > All e-mail sent to or from this e-mail address will be > received or otherwise recorded by > The Sharper Image corporate e-mail system and is subject to > archival, monitoring, > and review by and/or disclosure to Sharper Image security and > other management. > This message is intended only for the use of the addressee > and may contain information > that is privileged and confidential. > > The contents of this message may contain personal views which > are not the views of The Sharper Image. > If you are not the intended recipient, dissemination of this > communication is prohibited. > ***************************** > > -- > This is the RPG programming on the AS400 / iSeries (RPG400-L) > mailing list > To post a message email: RPG400-L@xxxxxxxxxxxx > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo/rpg400-l > or email: RPG400-L-request@xxxxxxxxxxxx > Before posting, please take a moment to review the archives > at http://archive.midrange.com/rpg400-l. > >
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.