The CA 2E 'Service Program' allows you to define a service program (i5/OS Object Type *SRVPGM) within a 2E model. The function is implemented as an i5/OS service program (*SRVPGM). Once a Service Program function has been created, you can specify that one or more model functions which were generated as *MODULE objects should be bound into it. You can also specify one or more external *MODULE objects (i.e. modules which were created outside the CA 2E model) to be bound into the service program.
Typically, most external functions in a CA 2E model are defined as programs (with an object type of *PGM). These external functions are 'callable' - they can be called from a command line or from another program, as long as the correct parameters are provided. However, it is possible to define an external function as a module (with an object type of *MODULE). These external functions are not directly callable, but must be bound into a calling program or into a service program. If a module is bound into a program, then it is 'bound-by-copy' - a copy of the *MODULE object is bound into the calling *PGM object. This increases the size of the *PGM object and means that if any changes are subsequently made to the module, all program functions into which it is bound must be updated to include the new object. However, if a module is bound into a service program, then any program functions which call the module function bind to the module using functions which call the module function bind to the module using 'bind-by-reference' - the program simply contains an internal reference to the service program which exports the module. At run-time, the program calls the module which is in the service program. In this way, the size of the *PGM object is kept to a minimum, and any subsequent changes to any of the modules bound into the service program simply require the service program to be updated, with the *PGM object automatically calling the updated version of the module function in the service program.