Thanks Scott,

I believe you are saying that a named group does not automatically end like a *new group. In that case,when would it end?

Currently I cannot do what I'd like to because the application is mainly OPM. After the first call, files of the previous library list may remain open so even if I change the library list the program will continue to use the files of the original library list.

The idea was that by converting the OPM source and using an activation group, this problem would evaporate with the activation group at the end of the program.

But as the user on each entry can effectively change the library list, I wondered if I could create a named activation group for each product and keep all my files open between calls.




-----Message d'origine-----
De : midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] De la part de Scott Klement
Envoyé : mercredi 7 janvier 2009 12:32
À : Midrange Systems Technical Discussion
Objet : Re: ACTGRP

Hi David,

*NEW activation groups end automatically when the program ends. (i.e.
the program that was built with ACTGRP *NEW). So there'd be no need to reclaim it when returning to the data entry screen! Because it was specified as *NEW, it's reclaimed automatically.

One challenge... *LIBL is not an attribute of the activation group, it's an attribute of the job. So when you change the *LIBL, you change it for all activation groups in the job. I guess that's not a problem as long as you're careful to change it back when your activation groups end.

If you don't want to close/open the files with each call, then you can't
use ACTGRP(*NEW). Instead, you could create 8 different NAMED
activation groups. Perhaps by having a simple CL program like this:

PGM

CHGLIBL LIBL(... as appropriate...)
CALL MYPGM
MONMSG CPF0000
CHGLIBL LIBL(... back to original...)

ENDPGM

Make that an ILE CL program (set the source member type to CLLE instead of CLP), and compile 8 different copies of it using the CRTBNDCL command. (or PDM 14, but make sure you prompt it) Have each copy use a different named activation group.

The programs that it calls ("MYPGM") would be ACTGRP(*CALLER). These would be your RPG program, and can be the same RPG program ... no need to have separate copies of it.

Since the RPG code is in *CALLER, and is run in a different activation group, there will be a separate activation for each one. If your data entry screen calls all 8 programs consecutively, it'll have 8 different activations, with 8 different sets of open files, etc. Then you don't have to open/close on each call if you don't want to.

It's really simple -- but hard to explain :(


David FOXWELL wrote:
Hello,

Starting from a data entry screen, I want to be able to call a program
using an activation group that lets me set up a library list for the
product entered. I currently have 8 different product environments.
Treating each product means using the same program to treat different
files but with the same names in different libraries.


I was thinking of having the program compiled with ACTGRP *NEW and
then deleting the activation group when the program returns to the
data entry screen.

Is it possible to have an activation group for each product so that I
don't need to close and reopen all my files between calls? I mean, if
I call myPgm in a named activation group ie, product1, then product2,
can I reuse product1 ?

If so, how would I get the same program to run in different named
activation groups? By duplicating the program?

Thanks.




David FOXWELL
Service Informatique
Tél : 03 90 23 91 63
david.foxwell@xxxxxxxxx<mailto:david.foxwe@xxxxxxxxx>

P Pensez à l'environnement avant d'imprimer ce message


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.