|
Hi Mike,
You say one of the files is different. Different in what way? Does it
have different fields that are used for different purposes?
You mention using an IF statement so I'm expecting something like this:
if FileType='ORANGE';
read ORANGEFIL;
else;
read APPLEFIL;
endif;
And, okay, that will work as far as it goes. But now which fields have
been loaded into the program? And what needs to be done differently
with the fields from ORANGEFIL vs APPLEFIL? I'm assuming there must be
something substantially different about the fields, otherwise you'd have
changed ORANGEFIL so that it works exactly the same as APPLEFIL (or
whatever your files happened to be named).
If the fields are substantially different and therefore require separate
code to handle them, then how can you call one a substitute for the
other? AT some point, there must be a common denominator, right?
Personally, I'd try to find the common denominator. Write a service
program that encapsulates the differences between the files to (probably
the wrong word) "normalize" the file access. Then use that service
program instead of reading the file directly.
Make sense?
Mike wrote:
I need to bounce this off you guys to see if there is a better way. Thisis
bugging every aspect of me and am looking for ideas to simplify my life.one
I have two sets of files. Out of the 5 files in the set of files, only
file in the set is different. So now I have a maintenance nightmare ofthat
having two programs exactly the same (and keep the same) except for the
files they use. Is there a way I can make this one program? I could use a
flag and put an if statement on every read/write/update/delete, but could
there be a better way? The other file is similar, but different enough
I think it would be best just to maintain two programs.
--
Mike Wills
Midrange Programmer/Analyst
Sick of corporate radio and hungry for something new?
http://thenextgenerationofradio.com
--
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.