IBM AS/400 Frozen Dessert Maker User Manual


 
Using Program-Described Disk Files
no record blocking is done by the compiler, nor by data management. If the
keyword BLOCK is not specified, then default blocking occurs as described above.
The input/output and device-specific feedback of the file information data structure
are not updated after each read or write (except for the RRN and Key information
on block reads) for files in which the records are blocked and unblocked by the
RPG compiler. The feedback area is updated each time a block of records is trans-
ferred. (For further details on the file information data structure see the
ILE RPG for
AS/400 Reference
.)
You can obtain valid updated feedback information by preventing the file from being
blocked and unblocked. Use one of the following ways to prevent blocking:
Specify BLOCK(*NO) on the file description specification.
At run time, use the CL command OVRDBF (Override with Database File) with
SEQONLY(*NO) specified.
Using Program-Described Disk Files
Program-described files, which are identified by an F in position 22 of the file
description specifications, can be described as indexed files, as sequential files, or
as record-address files.
Indexed File
An indexed file is a program-described DISK file whose access path is built on key
values. You must create the access path for an indexed file by using data
description specifications.
An indexed file is identified by an I in position 35 of the file description specifica-
tions.
The key fields identify the records in an indexed file. You specify the length of the
key field in positions 29 through 33, the format of the key field in position 34, and
the starting location of the key field in the KEYLOC keyword of the file description
specifications.
An indexed file can be processed sequentially by key, sequentially within limits, or
randomly by key.
Valid Search Arguments
For a program-described file, a search argument must be a single field. For the
CHAIN and DELETE operations, the search argument must be the same length as
the key field that is defined on the file description specifications for the indexed file.
For the other file operations, the search argument may be a partial field.
The DDS specifies the fields to be used as a key field. The KEYLOC keyword of
the file description specifications specify the starting position of the first key field.
The entry in positions 29 through 33 of the file description specifications must
specify the length of the key as defined in the DDS.
Figure 141 on page 289 and Figure 142 on page 289 show examples of how to
use the DDS to describe the access path for indexed files.
288 ILE RPG for AS/400 Programmer's Guide