IBM AS/400 User Manual Page 115

  • Download
  • Add to my manuals
  • Print
  • Page
    / 489
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 114
Service Program Overview
Chapter 8. Creating a Service Program
This chapter provides:
¹ An overview of the service program concept
¹ Strategies for creating service programs
¹ A brief description of the CRTSRVPGM command
¹ An example of a service program
Service Program Overview
A service program is a bound program (type *SRVPGM) consisting of a set of pro-
cedures that can be called by procedures in other bound programs.
Service programs are typically used for common functions that are frequently called
within an application and across applications. For example, the ILE compilers use
service programs to provide run-time services such as math functions and
input/output routines. Service programs enable reuse, simplify maintenance, and
reduce storage requirements.
A service program differs from a program in two ways:
¹ It does not contain a program entry procedure. This means that you cannot call
a service program using the CALL operation.
¹ A service program is bound into a program or other service programs using
binding by reference.
When you bind a service program to a program, the contents of the service
program are not copied into the bound program. Instead, linkage information of the
service program is bound into the program. This is called 'binding by reference' in
contrast to the static binding process used to bind modules into programs.
Because a service program is bound by reference to a program, you can call the
service program's exported procedures using bound procedure calls. The initial call
has a certain amount of overhead because the binding is not completed until the
service program is called. However, subsequent calls to any of its procedures are
faster than program calls.
The set of exports contained in a service program are the interface to the services
provided by it. You can use the Display Service Program (DSPSRVPGM) command
or the service program listing to see what variable and procedure names are avail-
able for use by the calling procedures. To see the exports associated with service
program PAYROLL, you would enter:
DSPSRVPGM PAYROLL DETAIL(*PROCEXP *DATAEXP)
Copyright IBM Corp. 1994, 1999 91
Page view 114
1 2 ... 110 111 112 113 114 115 116 117 118 119 120 ... 488 489

Comments to this Manuals

No comments