Using the Binder to Create a Service Program - IBM-ILE

Creating a service program involves compiling source code into module objects, and then binding one or more module objects into a service program object.with the Create Service Program (CRTSRVPGM) command. You can also use modules created with other ILE language compilers, such as ILE C/C++, ILE RPG/400, or ILE COBOL/400.

Considerations when Creating a Service Program
When creating a service program, you should consider:

  • Whether or not you intend to update the program at a later date.
  • Whether or not any updates involve changes to its interface.

If the interface to a service program changes, you may have to rebind all programs bound to the original service program. However, depending on the changes and how you implement them, you may be able to reduce the amount of rebinding if you create the service program using binder language. In this case, after updating the binder language source to identify new exports, you need to rebind only those programs that require the new exports.

Specifying Parameters for the CRTSRVPGM Command
Tablelists CRTSRVPGM command parameters and their default values.. For a detailed description of the parameters, refer to the CL Reference CHKxxx through CVTxxx Commands: SC41–5724. Each parameter has default values which are used whenever you do not specify your own values.

Parameters and Default Values for CRTSRVPGM Command

Parameters and Default Values for CRTSRVPGM Command

Updating or Changing a Service Program
You can update or change a service program in the same way you modify a program object. In other words, you can:

  • Update the service program (using UPDSRVPGM)
  • Change the optimization level (using CHGSRVPGM)
  • Remove observability (using CHGSRVPGM)
  • Reduce the size (using CPROBJ).

See “Updating a Module or a Program Object” for more information on any of the above points.

If you use binder language, a service program can be updated without requiring programs calling it to be recompiled. For example, to add a new procedure to an existing service program:

  1. Create a module object for the new procedure.
  2. Modify the binder-language source file to handle the interface associated with the new procedure. Add any new export statements following the existing ones.See “Updating a Service Program Export List” for details on modifying binder-language source files.
  3. Recreate the original service program and include the new module.

Now existing programs can access the new functions. Since the old exports are in the same order, they can still be used by the existing programs. Until it is necessary to also update the existing programs, they do not have to be recompiled.

Using Related CL commands
The following CL commands can be used with service programs:

  • Create Service Program (CRTSRVPGM)
  • Change Service Program (CHGSRVPGM)
  • Display Service Program (DSPSRVPGM)
  • Delete Service Program (DLTSRVPGM)
  • Update Service Program (UPDSRVPGM)
  • Work with Service Program (WRKSRVPGM).

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

IBM-ILE Topics