IBM AS/400 manual into a, Using, Crtpgm

Models: AS/400

1 489
Download 489 pages 47.95 Kb
Page 106
Image 106

Binding

Modules

into a

Program

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

In addition to binding modules together,

 

you can also bind them

to

se

 

 

 

grams (type *SRVPGM). Service programs allow you to code and maintain mod

 

 

 

separately from the program modules. Common

routines can be created as

 

 

 

programs

and

if

the routine

changes,

the

change

can be incorporated

 

 

 

the service program again. The programs

that

use

these

common routines

 

 

 

have to be recreated. For information on creating service programs see

 

 

 

“Creating

a

Service

Program”

on page 91.

 

 

 

 

 

 

 

 

 

 

 

 

For information on the binding

process

and

the

binder,ILE Conceptsrefer. to

the

 

Using

the

CRTPGM

Command

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The

Create

Program

(CRTPGM)

command

creates

 

a program

object

from

one

or

 

 

 

more

previously

created

modules

and,

if

required,

one

or

more

service

 

 

 

You can bind modules created by any of

the

ILE

Create

Module

command

 

 

 

CRTRPGMOD,

CRTCMOD,

CRTCBLMOD,

or

CRTCLMOD.

 

 

 

 

 

 

 

 

 

 

Note: The modules and/or service programs required must have been crea prior to using the CRTPGM command.

Before you create a program object using the CRTPGM command, you shoul

1.Establish a program name.

2.Identify the module or modules, and if required, service programs bind into a program object.

3.Identify the entry module.

You

indicate which module contains the program entry procedure throu

ENTMOD

parameter

of CRTPGM.

The

default is ENTMOD(*FIRST), meaning

that

the

module

containing

the

first program entry procedure found

the

MODULE

parameter is

the

entry module.

Assuming you have only one module with a main procedure, that is, al modules but one have NOMAIN specified, you can accept the default Alternatively, you can specify (*ONLY); this will provide a check that one module has a main procedure. For example, in both of the follow ations you could specify ENTMOD(*ONLY).

¹ You bind an RPG module to a C module without a main() function.

¹You bind two RPG modules, where one has NOMAIN on the control spe ification.

Note: If

you

are binding

more than one ILE RPG

module

with

a

main

dure, then you should specify the

name of

the

module

that y

receive

control

when

the

program

is

called.

You

can

also

speci

*FIRST

if

the

module

with

a main

procedure

precedes

any

othe

modules with main procedures on the list specified for the MO parameter.

4. Identify the activation group that the program is to use.

Specify the named activation group QILE if your program has no spec

requirements

or

if

you

are not sure which group to

use.

In

gener

idea

to

run

an

application

in

its

own activation

group. Therefore, y

to name the

activation

group

after

the

application.

 

 

 

Note

that

the

default

activation

group

for CRTPGM

is

*NEW.

This

means

your

program

will run

in

its

own

activation group,

and

the

activation

82 ILE RPG for AS/400 Programmer's Guide

Page 106
Image 106
IBM AS/400 manual into a, Using, Crtpgm