|
Douglas,
Without going into the separate question of whether you should put them
into a service program (Answer: Almost certainly), have you considered
putting both the PR and the procedure in the same copybook?
Basically, your copybook (MYPROC) contains the following:
IF NOT DEFINED(MYPROC)
DEFINE MYPROC
// PR goes here - also other required definitions
ELSE
// Procedure code goes here
ENDIF
Then, in your program, you simply include the copybook twice - once in the
D-specs and once at the very bottom of the source:
/COPY QRPGLESRC,MYPROC
Just a thought as a temporary solution...
Rory
On Fri, Jun 13, 2014 at 7:42 AM, Scott Mildenberger <
SMildenberger@xxxxxxxxxxxxxxxxxx> wrote:
Determining what procedure is actually run is a function of thedown
compile/bind steps. So the programs that get a procedure from a copybook
won't be affected at run time if the service program now contains a
function of the same name.
Even though execution won't be affected you will want to eventually get
those programs referencing the service program procedures. Otherwise,
the road someone will change a procedure in the service program expectingand
those original programs to see the change but they won't.
Scott
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
Englander, Douglas
Sent: Friday, June 13, 2014 8:28 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: ILE RPG question: function consolidation
I have several ILE RPG programs that have common subprocedures in them
those subprocedures are contained in a copybook. The copybook is manuallywith
copied into the source with a /COPY and the prototypes for those
subprocedures are in the D specs of the programs that use them. Some of
those programs also use our standard copybook that has other user written
functions that are in a service program. That service program is in the
binding directory keyword that is coded in all of the ILE RPG programs
the common subprocedures.programs
I noticed this morning if I manually code a prototype in an ILE RPG
program that is also in a copybook, the program will not compile as there
are duplicate entries in for the same functions.
My question is:
If I add those functions that are in copybooks to a service program, and
the service program is referenced in existing programs that may have the
hard coded prototypes in them (and the /COPY statement), will the
still work properly without recompiling?directory
In other words:
I have program A that uses function #1. In program A, function #1 is used
via a /COPY and PR statements. Program A is also compiled with a service
program, S.
I have program B that uses function #2. In program B, function #2 is used
via a /COPY and PR statements. Program B is also compiled with a service
program, S.
Programs A and B both have an H spec that references the binding
that contains an entry for service program S.service
Programs A and B are already in the production environment.
I then add functions #1 and #2 to service program S, but do not recompile
programs A nor B. I also add the associated prototypes to a prototype
copybook.
I have a third program C that uses both functions 1 and 2, without the
copybooks and PR statements, since the PR statements are now in the
prototype copybook and the code for the two functions is now in the
program (in development). Program C's H spec also references the bindingand
directory that contains an entry for service program S.
When C is moved to production with the updated service program, will A
B still function or will they need to be recompiled? I know how to manageand
the signatures, but since A and B now have a copy of the functions
internally, and those functions are now in the service program (that A
B also reference via the BNDDIR H spec keyword), will that cause anyerrors
when programs A or B are executed without a recompile?subscribe,
I hope this is not too confusing.
Thank you,
Doug
--
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
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.
--
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.
--
Rory Hewitt
http://www.linkedin.com/in/roryhewitt
--
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.
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.