On 04 Jan 2013 09:43, Vinay Gavankar wrote:
I have a program PGMA in Library LIB1
I have a batch job running executing another program PGMX. The
Library list of the batch job has LIB1 first followed by another
PGMX calls PGMA for every transaction. PGMA does what it is supposed
to do in fraction of a second and returns without setting on LR.
When this batch job is running, if I were to move PGMA from LIB1 to
LIB2, and then put in an updated version of PGMA in LIB1, what
exactly would happen?
1. PGMX will continue using old PGMA from memory.
2. If PGMA is "paged out" of memory of PGMX, it would get the new
PGMA from LIB1 (or if this happens before the new version is
installed, it would get the old version from LIB2).
3. Would the batch job go in MSGW under any condition?
1,2: The effect depends on if the call is: always fully dynamic by
name [new address resolved from the name], by cached address with
potential for dynamic by name, or fully static call by stored\static
address. The type of call being used, according to the rules of the
language being used, decides what happens in the described scenario of
replacing PGMA in LIB1.
1,2: In any case "in memory" and "paged out" are not germane. It is
the address of the program that decides which program is called. Two
programs with the same name are always different objects, with their own
specific address, and the CALL method will use the address rather than a
name to locate the executable code [what the caller does to get the
address is what makes the difference] so there is never a case of
calling any unknown one of many same-named programs "from memory"; the
program that will be called is always predictable according to how and
when the caller gets the address to the program to be called.
3: Under "any condition" the job _could_ go into MSGW; i.e. any
condition for which that effect was proper according to the system ;-)
Assuming both copies of PGMA were identical [parameters, etc.] with
all of the same attributes [e.g. authority, adoption, et al] then with
regards only to the CALL activity, either the PGMX would continue to
call the old PGMA since moved to LIB2 or the PGMX would start to call
the new PGMA since placed in LIB1. The described move and replace by
name is effectively what an Apply PTF [APYPTF] will do, and thus that
procedure has the same "it depends" for how\when the change takes effect
for programs that are already active; i.e. addressing, static vs
dynamic, decides which program gets called.
And of course batch vs interactive is also not relevant.