IBM AS/400 manual Using the, Specifying, Files

Models: AS/400

1 489
Download 489 pages 47.95 Kb
Page 333
Image 333

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Using

Commitment Control

 

 

 

 

 

 

 

 

 

 

 

The

 

default

scope

for a commitment definition is to

the

activation

g

 

 

program

 

issuing

the

STRCMTCTL

command,

that

is,

at

 

the

activation

group

le

 

 

Only

 

programs

that

 

run

 

within

 

that

activation

group

will

use

 

that

commit

 

 

nition.

OPM

programs

 

will

use

the

*DFTACTGRP

commitment

definition.

ILE

 

pro-

 

 

grams

will use the activation group they are associated with.

 

 

 

 

 

You

 

specify

the

 

scope for a commitment definition

on

the

 

commitment

s

 

 

(CMTSCOPE)

parameter

of

the

STRCMTCTL

command.

For

further

information

on

 

 

 

 

 

the

 

commitment control scope within ILE, refer to "Data

Management

 

Scopi

 

 

ILE

 

Concepts, and

also Datathe

Management manual.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Specifying

Files

for

Commitment

Control

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

To indicate that a DISK

file

is

to

run

under

commitment

control,

enter

 

 

COMMIT

in

the

keyword

field

of

the

file

description

specification.

 

 

 

When

a

 

program

specifies

commitment

control

for

 

a

file,

the

 

specific

 

 

only

 

to

 

the

input

 

and output operations made by this program

 

for

 

th

 

 

ment

 

control

does

not

apply

to

operations

other

than

input

and

output

 

 

does

not apply

to

 

files

that do not have commitment

control

specified

 

 

program

 

doing

the

 

input

or

output

operation.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

When

more

than

one

program accesses a file as a shared file, all

 

 

programs

must

specify

the

file

to

be

under

commitment

control.

 

 

 

 

Using the

COMMIT

Operation

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The

 

COMMIT operation tells the system that you have

completed

 

a

group

 

 

changes

 

to

the

files

 

under

 

commitment

control.

The

ROLBK

operation

 

elimi

 

 

the

 

current

group

 

of changes to the files under commitment

control.

F

 

 

on

how

to

specify

these

operation

codes and

 

what

each

operation

d

 

 

ILE

 

RPG for AS/400 Reference.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

If

 

the

system

fails,

it

implicitly

issues

a

ROLBK

operation.

You

 

ca

 

 

tity

of

the

last

 

successfully

completed

group

 

of

changes

using

the

 

 

in factor 1 of the COMMIT

operation

code,

and

the

notify-object

yo

 

 

STRCMTCTL

command.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

At the end of an

 

activation group or job, or when

you

issue

the

E

 

 

command,

 

the

OS/400

 

system

issues

an

implicit

ROLBK,

which

eliminates

any

 

 

changes

 

since

the

 

last

ROLBK

or

COMMIT

operation

that

you

issued.

 

To

 

 

that

all

your file operations

have

effect,

issue

a

COMMIT

operation

 

 

an

activation

group

or

 

job

operating

 

under

commitment

control.

 

 

 

 

 

 

 

 

The

 

OPEN

operation

permits

input

and

output

operations

to

be

made

 

to

 

 

the

 

CLOSE

operation

 

stops input and output operations from being made

 

 

However, the OPEN and CLOSE operations do not affect

the

COMMIT

and

RO

 

 

operations.

A

COMMIT

or ROLBK operation affects a file, even after t

 

 

been

closed.

For

example,

your

program

may

include

the

following

step

1. Issue COMMIT (for files already opened under commitment control).

2. Open a file specified for commitment control.

3. Perform some input and output operations to this file.

4. Close the file.

Chapter 16. Accessing Database 309Files

Page 333
Image 333
IBM AS/400 manual Using the, Specifying, Files