Back to: ILE RPG in Easy Bytes

In Unit 14 you learn about service programs—what they are, how to create and maintain them, and when to use them. The unit also presents the concept of service program signatures and how to control them using binder language. In addition, it explains ILE activation groups, and how the various activation group options affect the resources an application uses.
This course includes hands-on lab exercises to help you understand the concepts behind service programs, binder language, and activation groups.
This course is a unit of the ILE RPG in Easy Bytes series, a complete introductory ILE RPG programming self-guided tutorial.
- Before starting this course you must complete the required prerequisite course: 13. Procedures – ILE RPG in Easy Bytes
One-Time Payment
Members Only
Instead of paying for each unit individually, you may purchase a membership which will automatically enroll you at a discount in the entire “ILE RPG in Easy Bytes” series.
Service Programs
Under this technique, a program includes a main procedure and optional subprocedures; all code for the program is physically copied into the program during the binding process. The resulting program (*Pgm object) is a single entry point program. The entry module contains the main procedure, which is the first user-written code that is executed when the program is called.
But the calling program does not call the service program itself. Because a service program lacks a main procedure, you cannot call it. Instead, the caller invokes an individual procedure in a service program by using the same syntax that it would use if the procedure were bound to it by copy:
Instead of recreating the entire service program, though, you can use the UPDSRVPGM (Update Service Program) command to complete an abbreviated binding step. The UPDSRVPGM command lets you list just the module (or modules) that you want to remove from the original service program, replacing its code with the new version that now resides in the newly recompiled module. The UPDSRVPGM command performs the same functions as the CRTSRVPGM command, except that it replaces only the changed modules (i.
In a modular programming environment, you can also use Export to define a variable or a data structure whose contents are available across modules. If a data item is used across several modules, you must define it within each relevant module. But only one module actually allocates storage for that data item.
Activation Groups
The resources include the storage a program uses, certain error-handling routines, and temporary data management resources. Each job has its own activation groups, separate from other jobs. Within a job, a program can run in its own activation group, independent of other programs in the same job.
Sometimes you need to make minor changes in how a program functions without recompiling the program. Maybe it’s necessary for a program to redirect a file declaration to process a file in a specific library, a file of another name, or a specific file member. Or perhaps the program must change some other attribute of a file.
Lab Exercise
This lab teaches you how to create/update an ILE service program and use it with IBM i client programs; use a binding directory and binder language.
- Before starting this course you must complete the required prerequisite course: 13. Procedures – ILE RPG in Easy Bytes