The BLOCK keyword controls the blocking of records associated with
the file. The keyword is valid only for DISK or SEQ files.
If this keyword is not specified, 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:
- The file is program-described or, if externally described, it
has only one record format.
- 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 Management may still block records if fast sequential access
is set. This means that updated records might not be seen right away.
- One of the following is true:
- The file is an output file.
- If the file is a combined file, then it is an array or table file.
- The file is an input-only file; it is not a record-address file
or processed by a record-address file; and none of the following operations
are used on the file: READE, READPE, SETGT, SETLL, and CHAIN. (If
any READE or READPE operations are used, no record blocking will occur
for the input file. If any SETGT, SETLL, or CHAIN operations are used,
no record blocking will occur unless the BLOCK(*YES) keyword is specified
for the input file.)
If BLOCK(*YES) is specified, record blocking occurs as described
above except that the operations SETLL, SETGT, and CHAIN can be used
with an input file and blocking will still occur (see condition 3c
above). To prevent the blocking of records, BLOCK(*NO) can be specified.
Then no record blocking is done by the compiler.