IBM AS/400 Frozen Dessert Maker User Manual


 
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 positioned at the first record
that satisfies the search argument or the record retrieved is the first record that
satisfies the search argument. For example, the SETGT and SETLL operations
position the file at the first record on the access path that satisfies the operation
and the search argument. The CHAIN operation retrieves the first record on the
access path that satisfies the search argument. The DELETE operation deletes the
first record on the access path that satisfies the search argument. The READE
operation retrieves the next record if the portion of the key of that record (or the
record of the specified type) on the access path matches the search argument. The
READPE operation retrieves the prior record if the portion of the key of that record
(or the record of the specified type) on the access path matches the search argu-
ment. For more information on the above operation codes, see the
ILE RPG for
AS/400 Reference
.
Record Blocking and Unblocking
By default, the RPG compiler unblocks input records and blocks output records to
improve run-time performance in SEQ or DISK files when the following conditions
are met:
1. The file is program-described or, if externally described, it has only one record
format.
2. The keyword RECNO is not used in the file-description specification.
Note: If RECNO is used, the ILE RPG compiler will not allow record blocking.
However, if the file is an input file and RECNO is used, Data Manage-
ment may still block records if fast sequential access is set. This means
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 table file.
c. The file is an input-only file; it is not a record-address file or processed by a
record-address file; and uses only the OPEN, CLOSE FEOD, and READ
file operations. (In other words, the following file operations are not allowed:
READE, READPE, SETGT, SETLL, and CHAIN.)
The RPG compiler generates object program code to block and unblock records for
all SEQ or DISK files that satisfy the above conditions. Certain OS/400 system
restrictions may prevent blocking and unblocking. In those cases, performance is
not improved.
You can explicitly request record blocking by specifying the keyword BLOCK(*YES)
on the file-description specification for the file. The only difference between the
default record blocking and user-requested record blocking is that when
BLOCK(*YES) is specified for input files, then the operations SETLL, SETGT and
CHAIN can be used with the input file (see condition 3c above) and blocking will
still occur. If the BLOCK keyword is not specified and these operations are used,
no record blocking will occur.
You can also prevent the default blocking of records by specifying the keyword
BLOCK(*NO) on the file-description specification. If BLOCK(*NO) is specified, then
Chapter 16. Accessing Database Files 287