IBM AS/400 manual Cycle, DDM Files, Commitment Control in

Models: AS/400

1 489
Download 489 pages 47.95 Kb
Page 336
Image 336
DDM Files

DDM Files

Figure 156 on page 312 is an example showing conditional commitment control.

*..

1 ...

+...

2 ...

+...

3 ...

+...

4

...+...

5 ...

+...

6 ...

+...

7 ...

+...

*

FFilename++IPEASFRlen+LKlen+AIDevice+.Keywords+++++++++++++++++++++++

 

 

FMASTER

UF

E

K

 

DISK

 

COMMIT(COMITFLAG)

 

 

 

 

FTRANS

UF

E

K

 

DISK

 

COMMIT(COMITFLAG)

 

 

 

 

*.. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... *

CL0N01Factor1+++++++Opcode(E)+Factor2+++++++Result++++++++Len++D+HiLoEq.￿...

*If COMITFLAG = '1' the files are opened under commitment con￿trol,

*otherwise they are not.

C

*ENTRY

PLIST

 

C

 

PARM

COMITFLAG

C

 

:

 

C

 

:

 

 

*

 

 

*Use the COMMIT operation to complete a group of operation￿s if

*they were successful or rollback the changes if they were￿ not

*successful. You only issue the COMIT or ROLBK if the files

*were opened for commitment control (ie. COMITFLAG = '1')

*

 

 

 

C

UPDATE

MAST_REC

90

C

UPDATE

TRAN_REC

91

C

IF

COMITFLAG = '1'

 

C

IF

*IN90 OR *IN91

 

C

ROLBK

 

 

C

ELSE

 

 

C

COMMIT

 

 

C

ENDIF

 

 

C

ENDIF

 

 

C*

 

 

 

 

 

 

Figure

156. Example of Using Conditional Commitment Control

 

Commitment Control in

the

 

Program

Cycle

 

 

 

 

 

 

 

 

 

 

 

 

 

Commitment

control is

intended

for

full

procedural

files,

where

the input

is

under

your

control.

Do not use commitment control with primary

and

se

files,

where

input

and

output is

under the

control of

the RPG

program

following

are some of the reasons for this

recommendation:

 

 

 

¹

You

cannot

issue

a

COMMIT

operation

for

the

last

total output

in

you

¹

It

is

difficult

to

program

within

the

cycle

for

recovery

from

a

 

tion.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

¹

Level

indicators

are

not

reset

by

the

ROLBK

operation.

 

 

 

¹After a ROLBK operation, processing matching records may produce a sequence error.

DDM Files

ILE

RPG

programs

access

files

on remote

systemsdistributed throughdata man-

 

 

 

agement

 

(DDM).

DDM

allows

application

programs

on one

system

to

use

files

stored

on a remote system as database files. No

special

statements a

ILE

RPG

programs

to

support DDM

files.

 

 

 

 

 

 

A DDM

file

is

created by

a user or program on a

local (source)

syste

(with object

type

*FILE)

identifies

a

file

that

is kept

on

a remote

312 ILE RPG for AS/400 Programmer's Guide

Page 336
Image 336
IBM AS/400 manual Cycle, DDM Files, Commitment Control in