× 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.



"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx> wrote on 10/27/2016 10:02:18
AM:
So the question is how to get the data to/from that PF
without tying every RPG program to a static format.

The way we went was to use an MVC-like architecture
(view-controller-servicelayer-model) and use RPG-generated data structures
for our SQL tables. This data structure definitions for tables and views
are in copybooks for the MVC service layer and DAO model and is simply
included in all referencing programs as needed.

The trick here is that the SQL statements cannot use SELECT * and
must list all the columns for retrieval. UPDATE and INSERT statements are
in the same category but we use extended indicator arrays to control which
columns are UPDATEd or INSERTed at any given time. This way only a single
UPDATE or INSERT statement is required but you still get the flexibility
of not having to UPDATE or INSERT all columns at once.

Then, the parameter interfaces use OPTIONS(*VARSIZE) for the data
structure parameter so that additional columns can be added without having
to recompile all referencing programs. That is, of course, until
particular referencing programs actually need the new columns. At that
point, only those programs that need the new columns need to be recompiled
in order to let RPG generate the new data structure layout for those
programs based on the copybook previously mentioned.

Sincerely,

Dave Clark

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.