David,
Why are you using named activation groups? If you use ACTGRP(*NEW) for the 
switching program, you don't need several versions of it. As for the 
DFTACTGRP programs, if the starting program does a RCLRSC after the call 
to the switching program (and a RCLACTGRP if you stick to named activation 
groups), everything will be cleaned up after the call.
Joep Beckeringh
From:
David FOXWELL <David.FOXWELL@xxxxxxxxx>
To:
RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>
Date:
25-03-2009 14:58
Subject:
RE: OPM called by program running in a named activation group
Simon, I'd also like to be able to highlight the lines of the email I'm 
replying to with a >, how do you do that?
First of all, let me say that all our applications run in the DFTACTGRP. 
ILE and OPM. If there's bad design, I guess it starts there.
But what do you do, rewrite and/or convert everything to ILE so that it 
will run outside the DFTACTGRP?
We are running a program that exists in several versions, each one in its 
own ACTGRP. This will permit the application to start in a general 
environment (DFTACTGRP), then depending on user choice, switch to an 
environment specific to that choice. This will let us switch from families 
of files that exist in different libraries, eg File1, File2, etc exists in 
Lib1, Lib2, etc. We will have an ACTGRP per library containing each group 
of files.
So, we start in DFTACTGRP, go to named ACTGRP X, return to DFTACTGRP go to 
named ACTGRP Y, etc.
I appreciate your point. I don't think I've yet cut off my fingers, though 
and I'm only doing the best I can to avoid that.
-----Message d'origine-----
De : rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] 
De la part de Simon Coulter
Envoyé : mardi 24 mars 2009 22:04
À : RPG programming on the IBM i / System i
Objet : Re: OPM called by program running in a named activation group
On 24/03/2009, at 11:25 PM, David FOXWELL wrote:
I have an interactive program A running in DFTACTGRP at the start.
There's the start of your problem.
Depending on a choice of client type by the user, pgm B gets called in
the named ACTGRP for that type of client. Pgm B does nothing but call
pgm C so it is activated in the same group (ACTGRP *CALLER).
Since ACTGRP is an attribute of the compiled program and cannot be changed 
PGMB isn't really a single program but rather you have multiple programs 
compiled from the same source each compiled with a different name and 
specifying a different activation group. Yes?
So you bounce from *DFTACTGRP, to named ACTGRP, to *DFTACTGRP, to who 
knows where else? What a mess. Like I said earlier: bad design.
Why do you want/think you need a separate ACTGRP for each client?
I was worrying about pgm C calling anything outside it's ACTGRP.
In this case that is a legitimate concern but only because the design is 
so messed up. This sort of problem is entirely of your own making and can 
be fixed by correcting your use of activation groups.
Least intrusive fix would be to make PGMA run in a *NEW activation group 
then convert the RPGIII to RPG IV and run in *CALLER.
Proper fix is probably to revisit the use of separate activation groups 
for each client.
Give people a sharp tool and they'll just cut their fingers off.
Regards,
Simon Coulter.
--------------------------------------------------------------------
    FlyByNight Software         OS/400, i5/OS Technical Specialists
    
http://www.flybynight.com.au/
    Phone: +61 2 6657 8251   Mobile: +61 0411 091 400        /"\
    Fax:   +61 2 6657 8251                                   \ /
                                                              X
                  ASCII Ribbon campaign against HTML E-Mail  / \
--------------------------------------------------------------------
--
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.