|
<quote>Personally, I'd move the recursive procedure into the serviceas
program.</quote>
And then recompile the procedure with *CALLER?
Thanks
Bryce Martin
Programmer/Analyst I
570-546-4777
Charles Wilt <charles.wilt@xxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
06/15/2009 10:44 AM
Please respond to
RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>
To
"RPG programming on the IBM i / System i" <rpg400-l@xxxxxxxxxxxx>
cc
Subject
Re: Reclaiming Activation Groups.
Bryce,
How is the procedure in the service program you mention making it's
call? If it's via a prototype with EXTPGM, then you're create
activation groups unnecessarily.
Personally, I'd move the recursive procedure into the service program.
Charles
On Mon, Jun 15, 2009 at 10:17 AM, Bryce Martin<BMartin@xxxxxxxxxxxx>
wrote:
The only difference between your program and mine is that I use *Newis
instead of Named activation group. I know that the performance hit is
considerable in some cases. I'll have to revisit the texts on why *New
suggested for recursion.wrote:
Thanks
Bryce Martin
Programmer/Analyst I
570-546-4777
Charles Wilt <charles.wilt@xxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
06/15/2009 10:06 AM
Please respond to
RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>
To
"RPG programming on the IBM i / System i" <rpg400-l@xxxxxxxxxxxx>
cc
Subject
Re: Reclaiming Activation Groups.
h datfmt(*ISO) option(*SRCSTMT:*NODEBUGIO:*XREF:*SECLVL)
h timfmt(*ISO)
h dftactgrp(*NO) actgrp('BRYCE')
d MyProc pr
d nbr 10i 0 value
//Begin mainline
/free
MyProc(10);
*INLR = *ON;
return;
/end-free
p MyProc b
d MyProc pi
d nbr 10i 0 value
/free
if nbr <= 0;
dsply %char(nbr);
return;
endif;
MyProc(nbr - 1);
dsply %char(nbr);
return;
/end-free
p MyProc e
Works fine.
On Mon, Jun 15, 2009 at 9:49 AM, Bryce Martin<BMartin@xxxxxxxxxxxx>
Charles, the recursive "program" as I called it is already set up that
way. Its a subprocedure inside of a program wrapper that is compile
programAGI
*New. I don't think you can have a recursive call any other way onV5R4.
You can't do recursion w/o the AG *New. And you can only code *PGM
objects with AG *New. So the wrapper setup is already a requirement.
could make the outward facing program that is called by the OPM
-->AG
*New, but that is a performance beast.
Thanks
Bryce Martin
Programmer/Analyst I
570-546-4777
Charles Wilt <charles.wilt@xxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
06/15/2009 09:37 AM
Please respond to
RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>
To
"RPG programming on the IBM i / System i" <rpg400-l@xxxxxxxxxxxx>
cc
Subject
Re: Reclaiming Activation Groups.
On Mon, Jun 15, 2009 at 9:15 AM, Mark S.
Waterbury<mark.s.waterbury@xxxxxxx> wrote:
My project structure looks like this...
OPM Program calls RPGLE Program that has a named Activation Group
containandtheRPGLE Pgm calls modules in a service program. --> Module in Service
Program calls RPGLE Pgm with Activation *New (recursive BOM)
If I change the recursive BOM program and recompile I don't see the
changes until I reclaim activation group of the RPGLE Pgm that is in
Named activation group.With ACTGRP(*NEW), that program should be automatically deactivated
use of the individual or entity to which it is addressed and maythe *NEW AG gets reclaimed whenever that program returns.
Note that using ACTGRP(*NEW) in this way is not currently recommended.
The performance penalty is significant.
RPG IV supports recursive procedures. Consider moving the logic from
the RPGLE program into a procedure. Basically the RPGLE program would
become simply a wrapper that provides a way to call the procedure from
the command line as in this case, an OPM program.
Of course, if you do take my advice, then you'd indeed have the
problem you think you do :)
Consider making the RPGLE wrapper ACTGRP(*NEW) so that the users just
need to exit out of the program to get the latest. version.
Otherwise, just have them sign off and back on.
Charles
--
This is the RPG programming on the IBM i / System i (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.
--- This message (including any attachments) is intended only for the
intendedinformation that is non-public, proprietary, privileged, confidential,and
exempt from disclosure under applicable law. If you are not the
andrecipient, you are hereby notified that any use, dissemination,If
distribution, or copying of this communication is strictly prohibited.
you have received this communication in error, please notify us anduse of the individual or entity to which it is addressed and may contain
destroy this message immediately. ---
--list
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
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.
This is the RPG programming on the IBM i / System i (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.
--- This message (including any attachments) is intended only for the
information that is non-public, proprietary, privileged, confidential,
exempt from disclosure under applicable law. If you are not the intendedIf
recipient, you are hereby notified that any use, dissemination,
distribution, or copying of this communication is strictly prohibited.
you have received this communication in error, please notify us anduse of the individual or entity to which it is addressed and may contain
destroy this message immediately. ---
--list
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
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.
This is the RPG programming on the IBM i / System i (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.
--- This message (including any attachments) is intended only for the
--list
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
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.