Hi everyone! It's been a while since I had a question to post, but I just ran into something interesting.
I have a service program that I use to run CL commands from within RPG.
In this case, I am using the service program to set up a work file.
MONITOR;
runCommand('CLRPFM WORKFILE');
ON-ERROR;
runCommand('CRTPF WORKFILE');
ENDMON;
The error monitor catches when the workfile hasn't been created yet, and creates it. In subsequent calls, the file is cleared.
As time has gone on, sometimes users would get kicked out with an error message saying the system was trying to reference an object that no longer existed. The suggestions I found online were to make the activation group for the service program a NAMED activation group instead of *CALLER.
So I did that. NOW, the error monitor does not work. The first command fails and it falls into the on-error routine like normal. As soon as the second runCOmmand is attempted, though, I get a machine check saying it can't find the runCOmmand routine.
By checking the activation group it appears that the MONITOR/ON-ERROR routine is closing down the activation group. I am looking for confirmation on that theory. Does the MONITOR command reclaim resources when it goes into the error portion?
Thanks in advance!
Jim
I have a service program that I use to run CL commands from within RPG.
In this case, I am using the service program to set up a work file.
MONITOR;
runCommand('CLRPFM WORKFILE');
ON-ERROR;
runCommand('CRTPF WORKFILE');
ENDMON;
The error monitor catches when the workfile hasn't been created yet, and creates it. In subsequent calls, the file is cleared.
As time has gone on, sometimes users would get kicked out with an error message saying the system was trying to reference an object that no longer existed. The suggestions I found online were to make the activation group for the service program a NAMED activation group instead of *CALLER.
So I did that. NOW, the error monitor does not work. The first command fails and it falls into the on-error routine like normal. As soon as the second runCOmmand is attempted, though, I get a machine check saying it can't find the runCOmmand routine.
By checking the activation group it appears that the MONITOR/ON-ERROR routine is closing down the activation group. I am looking for confirmation on that theory. Does the MONITOR command reclaim resources when it goes into the error portion?
Thanks in advance!
Jim
Comment