× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



First of all, you don't have to move I/O to a separate module to remove the
need for recompiling.

You could simply mandate that no program access through the PF and instead
uses a LF with an explicit format. New fields can be added to the PF but
not added to any existing logical. Thus no programs would need to be
recompiled. Programs that need the new field would be modified to use a
newly created logical that includes the field. ( substitute SQL
tables/views/indexes as you wish)

Having said that, a DB module is a good idea, as long as it's done right.
By that I mean you don't just emulate RPG op-codes with your own procedures
and a DS from the file itself. Instead, the procedures should encapsulate
business logic.

Instead of
custDS = CUSTOMER_read(1234);
if custDS.credit_hold <> *ON;
//allow customer to purchase
endif;

You'd have
if not CUSTOMER_OnCreditHold(1234);
//allow customer to purchase
endif;

Personally, I think it's worthwhile to have to have a couple of layers.
Consider an INVENTORY *SRVPGM, I'd have modules named
INVENTORY - contains all the publicly exported procedures for the *SRVPGM
IVBINMAST - contains protected & private functions that operate on the "bin
master" table
IVMAST - contains protected & private functions that operate on the
"inventory master" table
IVTRNHIST - contains protected & private functions that operate on the
"inventory transaction history" table
...and so forth.

INVENTORY_MoveItem() would be a public procedure that would make calls into
protected procedures for the various tables.

Charles


On Fri, Jun 30, 2017 at 7:32 AM, Vinay Gavankar <vinaygav@xxxxxxxxx> wrote:

At my client, people are kicking around the idea of having a separate
program (module) that will do any required I/O. Existing files already have
tons of programs using them, so it would be done only for new files that
get created.

The idea is that by doing that, if and when a new field is added to the
file, you shouldn't have to recompile existing programs, unless they
require the new field.

Nobody of knows what would be the performance implications of doing it.

Client does not allow compiling files with *lvlchk(*no) and any new fields
are not necessarily added at the end of the file (they want keep the Audit
Stamp fields always at the end of file).

Questions I have is:
1. Is it feasible
2. Is it worth it from performance enhancement/degradation standpoint
3. If yes, how would you actually code it (in RPGLE) so that all programs
need not be recompiled.

Thanks in advance for any advise.
Vinay
--
This is the RPG programming on the IBM i (AS/400 and 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.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.