IBM AS/400 manual Record Blocking and Unblocking, ¹ A, Using Externally Described Disk Files

Models: AS/400

1 489
Download 489 pages 47.95 Kb
Page 311
Image 311

Using Externally Described Disk Files

¹ A

search argument cannot refer

to

a portion of

a

key

field.

If

a search argument refers to

a

partial key,

the

file

is positi

that satisfies the search argument or the record retrieved is the

satisfies the search argument. For

example,

the SETGT and SETLL

operati

position

the file

at the first record on the access path

that

sa

and the

search

argument. The CHAIN

operation

retrieves the

first

re

access path that satisfies the search argument. The DELETE operation first record on the access path that satisfies the search argumen

operation

retrieves the

next record if the portion of the key of

record of the specified type) on

the

access

path matches

the se

READPE

operation

retrieves

the prior record if the portion of the ke

(or the record of the

specified

type) on the

access path matche

ment.

For

more

information

on the above

operation ILEcodes,RPG forsee

the

AS/400

Reference.

 

 

 

 

 

Record Blocking and Unblocking

By default, the RPG compiler unblocks input records and blocks output improve run-time performance in SEQ or DISK files when the following cond are met:

1.The file is program-described or, if externally described, it h format.

2. The keyword RECNO is not used in the file-description specificatio

Note: If

RECNO

is

used, the

ILE

RPG

compiler

will not

allow record

However,

if

the file

is an

input

file

and RECNO is used, Da

ment

may

still

block records if fast sequential access is se

that

updated

records

might

not

be

seen

right

away.

3.One of the following is true: a. The file is an output file.

b. If the file is a combined file, then it is an array or ta

c. The file is an input-only file; it is not a record-address fi record-address file; and uses only the OPEN, CLOSE FEOD, and READ file operations. (In other words, the following file operations READE, READPE, SETGT, SETLL, and CHAIN.)

The RPG compiler generates object program code to block and unblock r

all SEQ or DISK files that satisfy the above

conditions. Certain OS/40

restrictions may prevent blocking and

unblocking.

In those

cases,

perfo

not

improved.

 

 

 

 

You

can explicitly request record

blocking by

specifying

the

keyword

on the file-description specification for the file. The only differe default record blocking and user-requested record blocking is that w

BLOCK(*YES) is specified for input

files,

then the operations SETLL, SETGT

CHAIN

can

be used with the input

file

(see condition 3c above) and

still

occur. If

the

BLOCK keyword

is not specified and these opera

no record

blocking

will

occur.

 

 

You can also prevent the default blocking of records by specifying BLOCK(*NO) on the file-description specification. If BLOCK(*NO) is specif

Chapter 16. Accessing Database 287Files

Page 311
Image 311
IBM AS/400 manual Record Blocking and Unblocking, ¹ A, Using Externally Described Disk Files