IBM AS/400 manual Path, Sharing an Open Data

Models: AS/400

1 489
Download 489 pages 47.95 Kb
Page 301
Image 301

 

 

 

 

 

 

 

 

 

 

 

 

 

Sharing an Open Data Path

 

 

 

 

 

included.

These

output operations can be processed by EXCEPT output,

output,

or

total

output.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(There

are

exceptions

to

these

 

rules

when

operating

under

commitment

See

“Using

Commitment

Control”

on page 307

for

 

more

information.)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Sharing an Open Data

Path

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

An open data path is

the

path

through

which all input and output

op

file are performed. Usually a separate open data path is defined

opened. If you specify SHARE(*YES) for

the

file creation or

 

on

an o

program’s open

data

path

for

the

file

is

shared

by subsequent

prog

the

file

concurrently.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The

position

of

the

current

record

is

kept

in

the

open

data

path

using

the

file.

If

you read a record in

one program and then rea

called

program,

the

record retrieved by the second read depends

open

data

path

is

shared.

If

the

open

data

path

is

shared,

the

current

record

in the

called

program

is determined

by

the

current

calling

program.

If

the

open

data

path

is

 

not

shared,

each

program

pendent

position

for

the

current

record.

 

 

 

 

 

 

 

 

 

 

If your program holds a record lock in a shared file and then cal program that reads the shared file for update, you can release t lock by :

¹ performing a READ operation on the update file by the second pro

¹ using the UNLOCK or the read-no-lock operations.

In ILE, shared files are scoped to either the job level or the Shared files that are scoped to the job level can be shared by running inany activation group within the job. Shared files that are s activation group level can beonlysharedbythe programs running in the same activation group.

The default scope for shared files is the activation group. For jo specify OVRSCOPE(*JOB) on the override command.

ILE RPG offers several enhancements in the area of shared ODPs. If procedure performs a read operation, another program or procedure c record as long as SHARE(*YES) is specified for the file in question. when using multiple-device files, if one program acquires a device, a program sharing the ODP can also use the acquired device. It is u grammer to ensure that all data required to perform the update is called program.

Sharing an open data path improves performance because the OS/400 sys does not have to create a new open data path. However, sharing an path can cause problems. For example, an error is signaled in the f

¹If a program sharing an open data path attempts file operations those specified by the first open (for example, attempting input although the first open specified only output operations)

Chapter 15. General File Considerations277

Page 301
Image 301
IBM AS/400 manual Path, Sharing an Open Data