Activation

After successfully creating an ILE program, you will want to run your code. The process of getting a program or service program ready to run is called activation. You do not have to issue a command to activate a program. Activation is done by the system when a program is called.

Activation performs the following functions:
  • Allocates and initializes the static data needed by the program or service program
  • Resolves imports to runtime addresses of the corresponding service program exports.

A program or service program can be activated in more than one activation group, even within the same job. Each activation is local to a particular activation group, and each activation has its own static storage. When a program or service program is used concurrently by many jobs, only one copy of that object's instructions resides in storage, but the static variables are separate for each activation.

By default, service programs are immediately activated during the call to a program that directly or indirectly requires their services. You can request deferred activation for a service program when you are binding an ILE program or a service program that is created for V6R1, or later. If you request deferred activation for a service program, the activation of a service program can be deferred until one of its imported procedures is called. To minimize activation costs both at program startup and throughout program execution, it is suggested that you specify deferred activation for the service programs that satisfy procedure imports and that are used only on infrequently traveled code paths.
Note:
  1. If you request deferred activation for a service program that satisfies a data import, partial immediate activation is required to initialize the static data.
  2. If you request deferred activation for a service program that satisfies a procedure import for a procedure pointer call, partial immediate activation is required to provide the binding for the procedure pointer call.
To specify the activation mode for a service program as either immediate or deferred, use *IMMED or *DEFER on the BNDSRVPGM parameter of the following CL commands:
  • Create Program (CRTPGM)
  • Create Service Program (CRTSRVPGM)
  • Update Program (UPDPGM)
  • Update Service Program (UPDSRVPGM)
The Add Binding Directory (ADDBNDDIRE) command provides a similar input field for a service program entry, and the Work with Binding Directory Entries (WRKBNDDIRE) command provides output of the activation mode of service program entries in a binding directory.
If either of the following is true:
  • Activation cannot find the needed service program
  • The service program no longer supports the procedures or data items represented by the signature
an error occurs and you cannot run your application.

For more details on program activation, refer to Program Activation Creation.

When activation allocates the storage necessary for the static variables used by a program, the space is allocated from an activation group. At the time the program or service program is created, you can specify the activation group that should be used at runtime.

For more information on activation groups, refer to Activation Group.