IBM AS/400 manual Creating a Service Program, Service Program Overview

Models: AS/400

1 489
Download 489 pages 47.95 Kb
Page 115
Image 115
Service Program Overview

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 s cedures that can be called by procedures in other bound programs.

Service programs are typically used for common functions that are fre within an application and across applications. For example, the ILE com service programs to provide run-time services such as math functions a input/output routines. Service programs enable reuse, simplify maintenanc reduce storage requirements.

A

service program

differs

from

a

program in two ways:

¹

It

does

not

contain a

program

entry procedure. This means that y

 

a

service

program using

the

CALL

operation.

¹A service program is bound into a program or other service progra binding by reference.

When you bind a service program to a program, the contents of the program are not copied into the bound program. Instead, linkage infor service program is bound into the program. This is called 'binding by contrast to the static binding process used to bind modules into pro

Because a service program is bound by reference to a program, you service program's exported procedures using bound procedure calls. The has a certain amount of overhead because the binding is not complet service program is called. However, subsequent calls to any of its faster than program calls.

The set of exports contained in a service program are

the

interf

provided

by

it.

You

can use

the Display

Service

Program

(DSPSRVPGM) c

or the service program listing

to see what variable and procedure n

able for

use

by

the

calling

procedures.

To see

the exports

associ

program PAYROLL, you would enter:

DSPSRVPGM PAYROLL DETAIL(*PROCEXP *DATAEXP)

Copyright IBM Corp. 1994, 1999

91

Page 115
Image 115
IBM AS/400 manual Creating a Service Program, Service Program Overview