Here is a way to make certain types of programs run more efficiently. If a program reading a file does not need the records in any particular order, then sequential processing will be much more efficient than reading by an access path. To do this in RPG, leave position 31 of the "F" specification for the file blank. This will cause the program to read the file sequentially.
When reading files sequentially, you can improve performance even more by overriding the file prior to calling the program. There are two parameters on the OVRDBF command which can improve the performance of sequential processing.
o The NBRRCDS parameter specifies the number of records moved as a unit from auxiliary storage to main storage. o The SEQONLY parameter specifies whether or not sequential processing is to be used, and if so, the number of records moved as a unit from the database to the internal data management buffer.
To calculate the values for these parameters use the following calculation: 4096 / record length. Round the answer to the nearest integer. This will cause the file to be blocked by a factor of 4K, which is what IBM recommends.
For example, if the file CUSTMAST has a record length of 68 bytes, the command would be:
OVRDBF FILE(CUSTMAST) NBRRCDS(60) SEQONLY(*YES 60)
Using this technique causes double buffering to occur, which results in very efficient processing
Robin Klima San Diego, California