IBM AS/400 manual Binding, Creating a Program with Static, Using the CRTBNDRPG Command

Models: AS/400

1 489
Download 489 pages 47.95 Kb
Page 84
Image 84
Creating a Program with Static

Using the CRTBNDRPG Command

Figure 31 on page 60 shows the screen which appears after entering above command.

 

 

 

 

 

 

 

 

 

Display Module

Source

 

 

 

 

 

 

Program:

EMPRPT

Library:

MYLIB

Module:

EMPRPT

1*==============================================================*

2 * MODULE NAME: EMPRPT

3

*

RELATED FILES:

EMPMST

(PHYSICAL FILE)

4

*

 

QSYSPRT

(PRINTER FILE)

5* DESCRIPTION: This program prints employee information

6

*

from the file EMPMST.

7*==============================================================*

8

FQSYSPRT

O

F

80

 

PRINTER

 

 

 

 

9

FEMPMST

IP

E

 

 

K DISK

 

 

 

 

10

 

 

 

 

 

 

 

 

 

 

 

11

D TYPE

 

 

S

 

8A

 

 

 

 

12

D EMPTYPE

 

 

PR

 

8A

 

 

 

 

13

D

CODE

 

 

 

 

1A

 

 

 

 

14

 

 

 

 

 

 

 

 

 

 

 

15

IEMPREC

 

01

 

 

 

 

More...

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Debug . . .

 

_________________________________________________________________

 

 

_______________________________________________________________________________

 

 

 

F3=End program

F6=Add/Clear breakpoint

F10=Step

F11=Display variable

 

 

ˆ F12=Resume

 

F17=Watch variable

F18=Work with watch

F24=More keys

˜

 

 

 

 

 

 

 

Figure 31.

Display Module Source display for EMPRPT

 

 

 

 

From this screen (the Display Module Source display) you can enter commands to display or change field values and set breakpoints to c program flow while debugging.

For more information on debugging see Chapter 11, “Debugging Programs” on page 163.

Creating a Program with Static

Binding

 

 

 

 

 

 

 

 

 

 

In this example you create

a

program

COMPUTE

using

CRTBNDRPG

to

which

y

bind a service program at program-creation time.

 

 

 

 

 

 

Assume that you want to bind the program COMPUTE to

services

which

you

purchased

to

perform advanced

mathematical computations.

The

binding

dir

to which

you

must bind your

source is

called

MATH.

This

directory

cont

name of a service program that contains the various

procedures

that

ma

services.

 

 

 

 

 

 

 

 

 

 

 

 

To create the object, type:

CRTBNDRPG PGM(MYLIB/COMPUTE)

DFTACTGRP(*NO) ACTGRP(GRP1) BNDDIR(MATH)

The source will

be

bound

to

the

service

program

specified in

the

bi

MATH at program-creation time. This means that calls

to the procedures

i

service program

will

take

less

time

than if

they

were dynamic

calls.

 

When the program is called, it will run in the named activation group G default value ACTGRP parameter on CRTBNDRPG is QILE. However, it is recom mended that you run your application as a unique group to ensure that ated resources are fully protected.

60 ILE RPG for AS/400 Programmer's Guide

Page 84
Image 84
IBM AS/400 manual Binding, Creating a Program with Static, Using the CRTBNDRPG Command