PDA

View Full Version : Changing modules in service programs



Guest.Visitor
01-31-2007, 07:36 AM
Are you saying that somewhere on the CRTBNDRPG command, you can specify a service program? That's news to me. I use CRTPGM. Anyway, the old service program is likely stuck in the activation group. You need to signoff/on to see the new version or you might get lucky with a RGCLACTGRP(name) as in name QILE. Chris

B.Morris
01-31-2007, 01:31 PM
Doug Englander wrote: > > The issue is that a user discovered a bug in one of the modules. I made the required change, and recompiled the module using CRTRPGMOD. I then recreated the service program using CRTSRVPGM. I did not recompile the RPG IV program. > > When I ran the RPG IV program in debug, I am expecting to see the new module in the service program being used. However, it is appearing to still be using the old version. > ... > My question is this: Since I used the CRTRPGBND command to create the RPG IV program, is the old copy of the service program (with the incorrect module code) still being used by the RPG IV program? That is what appears to be happening. Should I have made the RPG IV program a module, executed a CRTPGM with the binding directory parameter instead? Would this compilation scenario allow a change to the module in a service program without recompiling all of the RPG IV programs that reference or use that service program? Or, did I do the correct thing using CRTRPGBND, and is there something that I have not done to make the RPG IV program (short of recompiling it) use the newer version of the service program? > If a program had previously been running in a job, the old copy of the service program will be used until the activation group of the program ends. If the program was running in the default activation group, ACTGRP(*CALLER), the activation group would not end until the job ends. Try signing off and signing back on again. (You _could_ try RCLACTGRP, but in my experience, that can occasionally cause more abnormal things to happen. If you're not alert to the fact that RCLACTGRP might have caused them, you can waste a lot of time debugging a new problem that doesn't really exist. Speaking from harsh experience ... )

Guest.Visitor
02-01-2007, 04:44 AM
Thanks for all who replied to this. I did resolve the problem by signing off and signing back on again. The problem was that I had three windows open on my PC and I was signing off and on, but not on the window I was testing in. Doug

Guest.Visitor
02-02-2007, 11:39 AM
I have a question. My shop is running V5R2. I have a service program that currently contains 2 modules. The service program was created with CRTSRVPGM, and the modules were created with CRTRPGMOD. I am using binder source language. I also have an RPG IV program that uses one of the modules in the service program. The RPG IV program was compiled using CRTBNDRPG. The compile command also uses DFTACTGRP(*NO) and BNDDIR specified. The binding directory has in it an entry for the service program that contains the two modules. The issue is that a user discovered a bug in one of the modules. I made the required change, and recompiled the module using CRTRPGMOD. I then recreated the service program using CRTSRVPGM. I did not recompile the RPG IV program. When I ran the RPG IV program in debug, I am expecting to see the new module in the service program being used. However, it is appearing to still be using the old version. When I started debug, I told it to use the RPG IV program, and the new service program. I added the breakpoints to the RPG IV and the changed module. When the RPG IV program uses the module, I expect the debugger to flip to the module listing and show me the statements in there. Instead, I do not see that and the debugger just goes to the next RPG IV statement, and I get the wrong result from the service program module. My question is this: Since I used the CRTRPGBND command to create the RPG IV program, is the old copy of the service program (with the incorrect module code) still being used by the RPG IV program? That is what appears to be happening. Should I have made the RPG IV program a module, executed a CRTPGM with the binding directory parameter instead? Would this compilation scenario allow a change to the module in a service program without recompiling all of the RPG IV programs that reference or use that service program? Or, did I do the correct thing using CRTRPGBND, and is there something that I have not done to make the RPG IV program (short of recompiling it) use the newer version of the service program? Thank you, Doug