Changing Programs
Changing Programs
Changing Programs
The Change Program (CHGPGM) and Change Service Program (CHGSRVPGM) commands change the attributes of a program and service program without requiring recompiling. Some of the changeable attributes follow:
- The optimization attribute.
- The user profile attribute.
- Use adopted authority attribute.
- The profiling data attribute.
- The program text.
- Licensed Internal Code options.
- Storage model (only from *SNGLVL to *INHERIT).
The user can also force recreation of a program even if the specified attributes are the same as the current attributes. Do this by specifying the force program recreation (FRCCRT) parameter with a value of *YES.
The force program recreation (FRCCRT) parameter can also be specified with the values of *NO and *NOCRT. These values determine whether the requested program attributes are actually changed when the change requires that the program be re-created. Modifying the following program attributes may cause the program to be re-created:
- The Optimize program prompt (OPTIMIZE parameter)
- The Use adopted authority prompt (USEADPAUT parameter)
- The Profiling data prompt (PRFDTA parameter)
- The User profile prompt (USRPRF parameter)
- Licensed Internal Code options prompt (LICOPT parameter)
- Storage model prompt (STGMDL parameter)
A value of *NO for the force program recreation (FRCCRT) parameter means that the recreation is not forced, but if one of the program attributes requiring recreation has changed, the program is recreated. This option allows the system to determine whether a change is required.
Recreating a program with CHGPGM or CHGSRVPGM while one or more jobs is using the program may cause an “Object Destroyed” exception to occur, and these jobs may fail. By changing the command default for the force program recreation (FRCCRT) parameter to *NOCRT, you can prevent this from inadvertently happening.
You can use the number of threads (NBRTHD) parameter to take advantage of available processing unit cycles, especially on a multiprocessor system.