Commonly Asked Questions About ILE Activation Groups
** This thread discusses the article: Commonly Asked Questions About ILE Activation Groups **
The way I understand activation groups, the following practices seem to me to be the way to go. I hope someone with more understanding will correct me as needed. A job that is to be run from the command line, a menu, or as a submitted job should start with a program set to activation group *new. Any program called by this initial program should be set to activation group *caller unless it has has some special need for overrides that would be outside that of the initial program, in which case it also should be in activation group *new. When a program is created to run in a named activation group, a bunch of garbage (overrides, work space, and who knows what else) is left over when it ends that has to be cleaned up, either by running RCLACTGRP or by signing off the session. When a program is created to run in activation group *new, all this garbage is automatically cleaned up when that program ends. Sometimes you see indications of this garbage when you run a program, notice some changes that need to be made, make those changes and recompile the program, and when you run the program again, the changes don't seem to be there. It's not until you sign off and sign back in and then rerun the program that the changes show up. Signing off is a way of getting that garbage cleaned up. By having the initial program set to activation group *new and programs called by this initial program set to activation group *caller, not only is all the garbage caused by the initial program cleaned up when that program ends, but all the called programs' garbage is also cleaned up. This means that I no longer need to delete overrides done in those called programs. I also don't have to do a final call to any reentrant programs (programs that return to the caller with *INLR left off) in order to set *INLR off. There may be cases where overrides have to change several times during the running of a job. In this case, I may want to treat each of these cases as a separate job and have the starting program there also set to activation group *new. An example might be an inquiry program showing a list of items where each time an item is selected from the list, a report is printed to a different printer based on the class of the item. The inquiry program would be in a *new activation group, and the print program with its overrides to the printer would be in its own *new activation group so its overrides would be cleaned up as it ends and returns to the inquiry program. Most of the literature I've seen seems to say to avoid using *new as an activation group because of the overhead in creating and cleaning up after itself, but I would think that overhead is insignificant when used as above. The place where you would not want that overhead is in a report or posting program where thousands or millions of records are being processed and a program is being called for each of these records. That called program should not be set to *new. There may be cases where named activation groups might be useful. A service program which is used throughout the system might be an example. Its activation group could start as you go into your first task of the day and stay active until you sign off at the end of the day while each task would be doing its own cleanup as it ended leaving the service program active for other tasks to use.
** This thread discusses the article: Commonly Asked Questions About ILE Activation Groups **
The way I understand activation groups, the following practices seem to me to be the way to go. I hope someone with more understanding will correct me as needed. A job that is to be run from the command line, a menu, or as a submitted job should start with a program set to activation group *new. Any program called by this initial program should be set to activation group *caller unless it has has some special need for overrides that would be outside that of the initial program, in which case it also should be in activation group *new. When a program is created to run in a named activation group, a bunch of garbage (overrides, work space, and who knows what else) is left over when it ends that has to be cleaned up, either by running RCLACTGRP or by signing off the session. When a program is created to run in activation group *new, all this garbage is automatically cleaned up when that program ends. Sometimes you see indications of this garbage when you run a program, notice some changes that need to be made, make those changes and recompile the program, and when you run the program again, the changes don't seem to be there. It's not until you sign off and sign back in and then rerun the program that the changes show up. Signing off is a way of getting that garbage cleaned up. By having the initial program set to activation group *new and programs called by this initial program set to activation group *caller, not only is all the garbage caused by the initial program cleaned up when that program ends, but all the called programs' garbage is also cleaned up. This means that I no longer need to delete overrides done in those called programs. I also don't have to do a final call to any reentrant programs (programs that return to the caller with *INLR left off) in order to set *INLR off. There may be cases where overrides have to change several times during the running of a job. In this case, I may want to treat each of these cases as a separate job and have the starting program there also set to activation group *new. An example might be an inquiry program showing a list of items where each time an item is selected from the list, a report is printed to a different printer based on the class of the item. The inquiry program would be in a *new activation group, and the print program with its overrides to the printer would be in its own *new activation group so its overrides would be cleaned up as it ends and returns to the inquiry program. Most of the literature I've seen seems to say to avoid using *new as an activation group because of the overhead in creating and cleaning up after itself, but I would think that overhead is insignificant when used as above. The place where you would not want that overhead is in a report or posting program where thousands or millions of records are being processed and a program is being called for each of these records. That called program should not be set to *new. There may be cases where named activation groups might be useful. A service program which is used throughout the system might be an example. Its activation group could start as you go into your first task of the day and stay active until you sign off at the end of the day while each task would be doing its own cleanup as it ended leaving the service program active for other tasks to use.
Comment