×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
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
As an Amazon Associate we earn from qualifying purchases.