I was getting some terminology mixed up.

I have put my procedure into the service program that calls it and will
get rid of the EXTPGM way of calling it. I agree that it was not a very
good design choice. I'll see if this doesn't solve my problem...


Thanks
Bryce Martin
Programmer/Analyst I
570-546-4777



Charles Wilt <charles.wilt@xxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
06/15/2009 11:09 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.






Procedures aren't compiled with ACTGRP...

The service program has the ACTGRP parm. What does it use now?

The IBM recommendation is for *SRVPGMs to be ACTGRP(*CALLER), but many
times a named activation group does make sense. *NEW is not allowed
for *SRVPGMs.

Charles

On Mon, Jun 15, 2009 at 10:58 AM, Bryce Martin<BMartin@xxxxxxxxxxxx>
wrote:
<quote>Personally, I'd move the recursive procedure into the service
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 *New
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
is
suggested for recursion.


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>
wrote:
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
as
AG
*New. I don't think you can have a recursive call any other way on
V5R4.
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.
I
could make the outward facing program that is called by the OPM
program
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
-->
RPGLE 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
the
Named activation group.

With ACTGRP(*NEW), that program should be automatically deactivated
and
the *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
use of the individual or entity to which it is addressed and may
contain
information that is non-public, proprietary, privileged, confidential,
and
exempt from disclosure under applicable law. If you are not the
intended
recipient, you are hereby notified that any use, dissemination,
distribution, or copying of this communication is strictly prohibited.
If
you have received this communication in error, please notify us and
destroy this message immediately. ---
--
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 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
use of the individual or entity to which it is addressed and may contain
information that is non-public, proprietary, privileged, confidential,
and
exempt from disclosure under applicable law. If you are not the intended
recipient, you are hereby notified that any use, dissemination,
distribution, or copying of this communication is strictly prohibited.
If
you have received this communication in error, please notify us and
destroy this message immediately. ---
--
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 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
use of the individual or entity to which it is addressed and may contain
information that is non-public, proprietary, privileged, confidential, and
exempt from disclosure under applicable law. If you are not the intended
recipient, you are hereby notified that any use, dissemination,
distribution, or copying of this communication is strictly prohibited. If
you have received this communication in error, please notify us and
destroy this message immediately. ---
--
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.



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.