A block contains more than one record. Unblocking of input records and blocking of output records occurs under the following conditions:
For RELATIVE organization, blocking is not performed for OPEN OUTPUT.
If you specify BLOCK CONTAINS, it is ignored. The system determines the number of records to be blocked.
For RELATIVE organization, blocking is not performed for OPEN OUTPUT.
The BLOCK CONTAINS clause controls the number of records to be blocked. In the case of DISKETTE files, the system always determines the number of records to be blocked.
Even when all of the above conditions are met, certain OS/400 restrictions can cause blocking and unblocking to not take affect. In these cases, performance improvements will not be realized.
If you are using dynamically accessed indexed files, you can use READ PRIOR and READ NEXT to perform blocking. When using READ PRIOR and READ NEXT to perform blocking, you cannot change direction while there are records remaining in the block. To clear the records from a block, specify a random operation, such as a random READ or a random START, or use a sequential READ FIRST or READ LAST.
If an illegal change of direction takes place, file status 9U results. No further I/O is possible until the file is closed and reopened.
You can override blocking at run time by specifying SEQONLY(*NO) for the OVRDBF command.
For disk and database files, when you use BLOCK CONTAINS, and if the blocking factor of zero is specified or calculated, the system determines the blocking factor.
There are certain instances in which the blocking factor you specify may be changed.
Where a block of records is written or read, the I-O feedback area contains the number of records in that block. The I-O-FEEDBACK area is not updated after each read or write for files where multiple records are blocked and unblocked by ILE COBOL. It is updated when the next block is read or written.
For database files with blocking in effect, you may not see all changes as they occur, if the changes are made in different programs.
Blocking is implicitly disabled if the file has alternate record keys.
For a description of the effect of blocking on changes to database files and changing the blocking factor, see the DB2 Universal Database for AS/400 section of the Database and File Systems category in the iSeries 400 Information Center at this Web site - http://publib.boulder.ibm.com/pubs/html/as400/infocenter.htm.
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.