Service Program

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Service Program as PDF for free.

More details

  • Words: 662
  • Pages: 2
Definition of a Service Program A service program is a collection of runnable procedures and available data items that are used by other ILE program objects and service programs. Service programs are system objects of type *SRVPGM and have a name specified when the service program is created. You use the Create Service Program (CRTSRVPGM) command to create a service program. A service program resembles a program object in that both consist of one or more module objects bound together to make a runnable object. However, a service program differs in that it has no PEP. Since it has no PEP, it cannot be called nor canceled. In place of a PEP, the service program can export procedures. Only the exported procedures from the service program can be called through a static procedure call made from outside of the service program. Exports of service programs are defined using the binder language.

Using Service Programs Service programs are typically used for common routines that are frequently called within an application and across applications. For example, the ILE COBOL compiler uses service programs to provide runtime services such as math functions and input/output routines. Service programs enable reuse of source programs, simplify maintenance, and reduce storage requirements. In many respects, a service program is similar to a subroutine library or procedure library. You can update a service program without having to re-create the other program objects or service programs that use the updated service program provided that the interface is unchanged or changed only in an upward compatible manner. You control whether the changes are compatible with the existing support provided by the service program. To make compatible changes to a service program, new procedure names or data names should be added to the end of the export list and the same signature as before must be retained.

Writing the Binder Language Commands for an ILE COBOL Service Program The binder language allows you to define the list of procedure names and data items that can be exported from a service program. For a full description of the binder language and the binder language commands, refer to the ILE Concepts book. A signature is generated from the names of procedures and date items and from the order in which they are specified in the binder language. A signature is a value that identifies the interface supported by the service program. You can also explicitly specify the signature with the SIGNATURE parameter in the binder language. For service programs created from ILE COBOL source programs, the following language elements are module exports that can be included in the export list of the binder language: • •

The name in the PROGRAM-ID paragraph in the outermost ILE COBOL program of a compilation unit. The ILE COBOL compiler generated name derived from the name in the PROGRAM-ID paragraph in the outermost ILE COBOL program of a compilation unit provided that program

does not have the INITIAL attribute. The name is derived by adding the suffix _reset to the name in the PROGRAM-ID paragraph. This name needs to be included in the export list only if the ILE COBOL program in the service program needs to be canceled.

Using the Retrieve Binder Source (RTVBNDSRC) Command as Input The Retrieve Binder Source (RTVBNDSRC) command can be used to retrieve the exports from a module or a set of modules, and place them (along with the binder language statements needed for the exports) in a specified file member. After the binder language has been retrieved into a source file member, you can edit the binder language to make changes as needed. This file member can later be used as input to the SRCMBR parameter of the Create Service Program (CRTSRVPGM) command. By default, the CRTSRVPGM command has a binder language file specified on the EXPORT and SRCFILE parameters to identify the exports from the service program. The RTVBNDSRC command can be useful in helping you automatically create this binder language.

Related Documents

Service Program
November 2019 4
Service
April 2020 15
Service
November 2019 35
Service
June 2020 9